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