Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/395.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 超出dropzone.js文件上载最大请求长度_Javascript_C#_Asp.net Mvc_Azure Web App Service_Dropzone.js - Fatal编程技术网

Javascript 超出dropzone.js文件上载最大请求长度

Javascript 超出dropzone.js文件上载最大请求长度,javascript,c#,asp.net-mvc,azure-web-app-service,dropzone.js,Javascript,C#,Asp.net Mvc,Azure Web App Service,Dropzone.js,我正在使用dropzone,上载大于18MB的文档时遇到问题。我一直收到超过最大请求长度的错误,无法理解原因。我已经研究了好几天了,现在还没弄明白。下面是我的配置示例。拔出我在这件事上留下的头发 dropzone js代码: $("#dz-documents").dropzone({ url: "/upload/UploadDocument", maxFiles: 1, maxFilesize: 500.0,

我正在使用dropzone,上载大于18MB的文档时遇到问题。我一直收到超过最大请求长度的错误,无法理解原因。我已经研究了好几天了,现在还没弄明白。下面是我的配置示例。拔出我在这件事上留下的头发

dropzone 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]
公共异步任务上载文档()
{
尝试
{
//上载组件的名称为“文件”
if(Request.Files!=null)
{
OrganizationUser=等待ApplicationUserManager.GetOrganizationUser(user.Identity.GetUserId());
//截取的验证码
CloudStorageAccount-storageAccount=CloudStorageAccount.Parse(Microsoft.Azure.CloudConfigurationManager.GetSetting(“AvnCludStorage”);
foreach(Request.Files中的字符串名称)
{
HttpPostedFileBase file=Request.Files[name];
if(wait docRepository.Save(文件,Request.Files.AllKeys,user.OrganizationID,user.ID,user.UserID.Value.ToString())
{
返回内容(“上传成功”);
}
其他的
{
返回内容(“上传时出错”);
}
}
}
返回内容(“上传时出错”);
}
捕获(例外情况除外)
{
记录器错误(ex);
掷骰子;
}
}
web.config

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

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

您能试试这个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>

就是这样。我在错误的运行时设置了它。非常感谢。
<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>