Azure Storage에 웹 API 업로드-요청 엔터티가 너무 큼

Kubi

Web Api (다른 도메인)를 통해 Web App에서 Azure Storage로 파일을 업로드하려고합니다. Web Api에서 maxRequest 길이를 늘리고 있지만 4MB 이상의 파일을 업로드하려고하면 예외 413 : Request Entity Too Large가 발생합니다. 이 문제를 해결하기 위해 설정할 수있는 Azure Storage에 제한이 있나요?

    public string UploadFromByteArray(Byte[] fileStream, string filename)
    {
        try
        {
            ConfigureCors(account);

        }
        catch (Exception ex)
        {

            //throw;
        }
        // set the content type to image
        //blob.Properties.ContentType = "image/pjpeg";

        //blob.Metadata.Add("ModelName", Guid.NewGuid().ToString());
        //blob.SetMetadata();
        var permissions = BlobContainer.GetPermissions();
        permissions.PublicAccess = BlobContainerPublicAccessType.Blob;
        BlobContainer.SetPermissions(permissions);
        CloudBlockBlob blob = BlobContainer.GetBlockBlobReference(filename);
        blob.UploadFromByteArray(fileStream, 0, fileStream.Length);

        return blob.Uri.AbsoluteUri;
    }

    private void ConfigureCors(Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount)
    {




        try
        {
            var blobClient = storageAccount.CreateCloudBlobClient();

            ServiceProperties blobServiceProperties = new ServiceProperties()
            {
                HourMetrics = null,
                MinuteMetrics = null,
                Logging = null,
            };

            blobServiceProperties.Cors.CorsRules.Add(new CorsRule()
            {
                AllowedHeaders = new List<string>() { "*" },
                AllowedMethods = CorsHttpMethods.Put | CorsHttpMethods.Get | CorsHttpMethods.Head | CorsHttpMethods.Post,
                AllowedOrigins = new List<string>() { "*" },
                ExposedHeaders = new List<string>() { "*" },
                MaxAgeInSeconds = 3600 // 30 minutes 

            });

            blobClient.SetServiceProperties(blobServiceProperties);
        }
        catch (Exception ex)
        {

            throw;
        }
    }


<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=301879
  -->
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
//
//

  </connectionStrings>
  <appSettings>
//
  </appSettings>

  <system.web>

    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.5" />
  <httpRuntime targetFramework="4.5" maxRequestLength="102400" executionTimeout="2100" />
  </system.web>
  <system.webServer>
    <security>
      <requestFiltering>
        <!-- 100 MB in bytes -->
        <requestLimits maxAllowedContentLength="104857600" maxQueryString="104857600" />
      </requestFiltering>
    </security>
    <modules>
      <remove name="FormsAuthentication" />
    </modules>
    <handlers>
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <remove name="OPTIONSVerbHandler" />
      <remove name="TRACEVerbHandler" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.6.4.0" newVersion="5.6.4.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Ninject" publicKeyToken="c7192dc5380945e7" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
</configuration>
Kubi

확인. SingleBlobUploadTresholdInBytes를 최대로 설정하여 문제를 해결할 수 있습니다. 값. 이것이 올바른 해결책인지 확실하지 않습니다. 여기 심판이 있습니다. https://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storage.blob.blobrequestoptions.singleblobuploadthresholdinbytes(v=azure.10).aspx

        BlobRequestOptions options = new BlobRequestOptions();
        options.SingleBlobUploadThresholdInBytes = 67108860;
        blob.UploadFromByteArray(fileStream, 0, fileStream.Length, options:options);

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

(413) 요청 엔터티가 너무 큼-Azure에서 Wcf를 업로드 할 때

분류에서Dev

AWS API Gateway : 상태 코드 413, 요청 엔터티가 너무 큼

분류에서Dev

(413) WCF에서 요청 엔터티가 너무 큼

분류에서Dev

Python 요청 업로드 파일-413 요청 엔티티가 너무 큼

분류에서Dev

오류 : NODE 서버에서 요청 엔티티가 너무 큼

분류에서Dev

413 요청 엔티티가 너무 큼

분류에서Dev

Parse.com 413 요청 엔터티가 너무 큼

분류에서Dev

413 요청 엔터티가 너무 큼 WCF

분류에서Dev

413 요청 엔터티가 너무 큼-Elastic Beanstalk +로드 밸런서 + Node.js 애플리케이션

분류에서Dev

413 요청 엔터티가 너무 큼 오류에 대해 WCF 서비스 응용 프로그램을 구성하는 방법

분류에서Dev

Java Apache HttpClient의 요청 엔티티가 너무 큼 오류

분류에서Dev

413 요청 엔터티가 너무 큼 Windows 용 Laravel Homestead의 nginx 서버

분류에서Dev

AWS nginx / 1.16.1- "413 요청 엔터티가 너무 큼"및 Spring 부팅 jar

분류에서Dev

WCF 413 요청 엔터티가 너무 큼-자체 호스팅 WebHttpBinding

분류에서Dev

APache2 역방향 프록시 뒤의 NodeJS 애플리케이션이 업로드 파일에서 "413 요청 엔티티가 너무 큼"오류를 얻습니다.

분류에서Dev

Dropbox 노드 API 오류 400 요청 헤더 또는 쿠키가 너무 큼 수정하는 방법

분류에서Dev

JSONP 414 (요청 URI가 너무 큼)

분류에서Dev

Node / Nginx, 413 요청 엔티티가 너무 큼, client_max_body_size 세트

분류에서Dev

413 요청 엔터티가 너무 큼-일반 수정이 작동하지 않음

분류에서Dev

"요청 엔티티가 너무 큼"오류가 발생하는 이유는 무엇입니까?

분류에서Dev

UploadReadaheadsize 값이 확인되었지만 해결되지 않은 요청 엔티티가 너무 큼 오류

분류에서Dev

파일 크기 업로드 위반에 대한 상태 400 (잘못된 요청) 또는 413 (페이로드 너무 큼)?

분류에서Dev

AngularJS $ resource-414 요청 URI가 너무 큼

분류에서Dev

웹 API 요청 콘텐츠가 작업 필터에서 비어 있습니다.

분류에서Dev

Jenkins-잘못된 메시지 431 이유 : 요청 헤더 필드가 너무 큼

분류에서Dev

picasa gdata python 클라이언트 API GooglePhotosException : 413, '요청 항목이 너무 큼'

분류에서Dev

OpenFaas-요청 항목이 너무 큼

분류에서Dev

HTTP 413 : 요청이 너무 큼

분류에서Dev

웹 API C #에서 Azure Media Service에 .mp4 업로드

Related 관련 기사

  1. 1

    (413) 요청 엔터티가 너무 큼-Azure에서 Wcf를 업로드 할 때

  2. 2

    AWS API Gateway : 상태 코드 413, 요청 엔터티가 너무 큼

  3. 3

    (413) WCF에서 요청 엔터티가 너무 큼

  4. 4

    Python 요청 업로드 파일-413 요청 엔티티가 너무 큼

  5. 5

    오류 : NODE 서버에서 요청 엔티티가 너무 큼

  6. 6

    413 요청 엔티티가 너무 큼

  7. 7

    Parse.com 413 요청 엔터티가 너무 큼

  8. 8

    413 요청 엔터티가 너무 큼 WCF

  9. 9

    413 요청 엔터티가 너무 큼-Elastic Beanstalk +로드 밸런서 + Node.js 애플리케이션

  10. 10

    413 요청 엔터티가 너무 큼 오류에 대해 WCF 서비스 응용 프로그램을 구성하는 방법

  11. 11

    Java Apache HttpClient의 요청 엔티티가 너무 큼 오류

  12. 12

    413 요청 엔터티가 너무 큼 Windows 용 Laravel Homestead의 nginx 서버

  13. 13

    AWS nginx / 1.16.1- "413 요청 엔터티가 너무 큼"및 Spring 부팅 jar

  14. 14

    WCF 413 요청 엔터티가 너무 큼-자체 호스팅 WebHttpBinding

  15. 15

    APache2 역방향 프록시 뒤의 NodeJS 애플리케이션이 업로드 파일에서 "413 요청 엔티티가 너무 큼"오류를 얻습니다.

  16. 16

    Dropbox 노드 API 오류 400 요청 헤더 또는 쿠키가 너무 큼 수정하는 방법

  17. 17

    JSONP 414 (요청 URI가 너무 큼)

  18. 18

    Node / Nginx, 413 요청 엔티티가 너무 큼, client_max_body_size 세트

  19. 19

    413 요청 엔터티가 너무 큼-일반 수정이 작동하지 않음

  20. 20

    "요청 엔티티가 너무 큼"오류가 발생하는 이유는 무엇입니까?

  21. 21

    UploadReadaheadsize 값이 확인되었지만 해결되지 않은 요청 엔티티가 너무 큼 오류

  22. 22

    파일 크기 업로드 위반에 대한 상태 400 (잘못된 요청) 또는 413 (페이로드 너무 큼)?

  23. 23

    AngularJS $ resource-414 요청 URI가 너무 큼

  24. 24

    웹 API 요청 콘텐츠가 작업 필터에서 비어 있습니다.

  25. 25

    Jenkins-잘못된 메시지 431 이유 : 요청 헤더 필드가 너무 큼

  26. 26

    picasa gdata python 클라이언트 API GooglePhotosException : 413, '요청 항목이 너무 큼'

  27. 27

    OpenFaas-요청 항목이 너무 큼

  28. 28

    HTTP 413 : 요청이 너무 큼

  29. 29

    웹 API C #에서 Azure Media Service에 .mp4 업로드

뜨겁다태그

보관