2016-05-20 13 views
1

私はdropzoneを使用しており、18MBを超える文書のアップロードに問題があります。私は受信を続けています最大要求長がエラーを超えたため、理由を理解できません。私は数日間これを研究しており、それを理解することはできません。私の設定の例は以下の通りです。私はこの髪の毛で何を捨てましたか。dropzone.jsファイルのアップロード最大要求長を超えました

ドロップゾーンのjsコード:

$("#dz-documents").dropzone({ 
      url: "/upload/UploadDocument", 
      maxFiles: 1, 
      maxFilesize: 500.0, 
      addRemoveLinks: true, //*** 2/19/15 RKH *** changed 
      uploadMultiple: false, 
      autoProcessQueue: true, 
      paramName: links, 
      height: '150px', 
      dictResponseError: 'Error uploading file!', 
      init: function() { 
       this.on("complete", function (file) { 
        if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) { 
         this.removeFile(file); 

         // reload documents 
         Documents.loadDocuments($('#hdfObjectId').val(), $('#hdfRecordId').val()) 

         Activity[0].refreshActivity($('#hdfObjectId').val(), $('#hdfRecordId').val()) 
        } 
       }); 
      } 
     }); 

のC#:

[HttpPost] 
    public async Task<ActionResult> UploadDocument() 
    { 
     try 
     { 
      // The Name of the Upload component is "files" 
      if (Request.Files != null) 
      { 
       OrganizationUser user = await ApplicationUserManager.GetOrganizationUser(User.Identity.GetUserId()); 

       // snipped validation code 
       CloudStorageAccount storageAccount = CloudStorageAccount.Parse(Microsoft.Azure.CloudConfigurationManager.GetSetting("avnCloudStorage")); 

       foreach (string name in Request.Files) 
       { 
        HttpPostedFileBase file = Request.Files[name]; 

        if (await docRepository.Save(file, Request.Files.AllKeys, user.OrganizationID, user.ID, user.UserID.Value.ToString())) 
        { 
         return Content("Upload was successful"); 
        } 
        else 
        { 
         return Content("Error occurred on upload"); 
        } 
       } 
      } 

      return Content("Error occurred on upload"); 
     } 
     catch (Exception ex) 
     { 
      logger.Error(ex); 
      throw ex; 
     } 
    } 

web.configファイル

<system.webServer> 
<security> 
    <requestFiltering> 
    <requestLimits maxAllowedContentLength="2147483648" /> 
    </requestFiltering> 
</security> 
</system.webServer> 

<system.web> 
<runtime executionTimeout="240" maxRequestLength="2097152"> 
<system.web> 

答えて

2

は、あなたがこの2GBの最大を試みることができる:

<system.web> 
    <compilation debug="true" targetFramework="4.5" /> 
    <httpRuntime targetFramework="4.5" maxRequestLength="2147483" executionTimeout="1600" requestLengthDiskThreshold="2147483647" /> 
</system.web> 

<system.webServer> 
    <security> 
    <requestFiltering> 
     <requestLimits maxAllowedContentLength="2147483647" /> 
    </requestFiltering> 
    </security> 
</system.webServer> 
+0

それはそれだった。間違ったランタイムでセットアップしました。本当にありがとう。 – chadn

関連する問題