[英]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.