简体   繁体   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)
                    {
}}

above is my C# code to fetch the files and save to custom path. 上面是我的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 () {}}  

Above is my java script code for dropzone. 上面是我的dropzone的Java脚本代码。 Here I have given maxFilesize as 500MB and I am trying to upload file of 22MB size, getting error as "Maximum request length exceeded" in C# and Request.Files.Count is showing 0 count. 在这里,我将maxFilesize设置为500MB,并尝试上传22MB大小的文件,并在C#中收到“超出最大请求长度”错误,并且Request.Files.Count显示0个计数。 Please help me on this.Thanks in advance. 请对此提供帮助。谢谢。

It allow to upload file with max size of 2GB. 它允许上传最大2GB的文件。 update this setting in web.config file 更新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.

相关问题 限制上传的文件大小大于20 mb [cloudinary api] - restrict uploading file size greater than 20 mb [cloudinary api] 上载PDF文件并验证大小不超过2mb - Uploading PDF file and validates the size not more than 2mb 当尝试上传超过 5mb 的文件时,Dropzone.js 在 500 后出现错误(内部服务器错误) - Dropzone.js get error on post 500 (Internal Server Error) when try to upload file more then 5mb 停止将大小超过5mb的文件附加到多个文件输入中 - stop attaching files that size more than 5mb to multiple file input 无法使用 Angular JS 在 CSV 文件中保存超过 8Mb 的内容 - Unable to save content more than 8Mb in a CSV file with Angular JS Cloudinary 图像大小为 10 mb,但无法使用 node.js 上传甚至 500 kb 的图像 - Cloudinary image size is 10 mb but unable to upload images of even 500 kb using node.js 如何将20mb视频发送到跨域站点 - How To Send 20mb Video To Cross-Domain Site 在Android应用程序中无法访问大于10mb的文件 - Unable to access file larger than 10mb in Android application 如何处理超过 500 MB 的图像? - How can I process more than 500 MB worth of images? 总是上传20个甚至超过20个文件吗? - Always get 20 even more than 20 files uploaded?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM