繁体   English   中英

即使在DropZone中将maxFilesize设置为500,也无法加载文件大小超过20MB的文件

[英]Unable to load file with file size more than 20MB even though maxFilesize is set to 500 in DropZone

for (int i = 0; i < Request.Files.Count; i++)
                {
                    HttpPostedFileBase file = Request.Files[i];
                    //Save file content goes here
                    fName = file.FileName;
                    if (file != null && file.ContentLength > 0)
                    {
}}

上面是我的C#代码,用于提取文件并保存到自定义路径。

Dropzone.options.dropzoneForm = {
            autoProcessQueue: false,
            uploadMultiple: true,
            parallelUploads: 100,
            maxFiles: 100,
            maxFilesize: 500,
            acceptedFiles: 'image/jpeg,image/png,image/tiff,application/pdf,.pdf,.jpeg,.jpg,.tiff,.tif,.pdf',
            init: function () {}}  

上面是我的dropzone的Java脚本代码。 在这里,我将maxFilesize设置为500MB,并尝试上传22MB大小的文件,并在C#中收到“超出最大请求长度”错误,并且Request.Files.Count显示0个计数。 请对此提供帮助。谢谢。

它允许上传最大2GB的文件。 更新web.config文件中的此设置

<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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM