为什么Dropzone无法进行大型上传?

时间:2021-04-18 18:59:03

maxAllowedContentLength and maxRequestLength are set in my web.config file; however, large (1.8 GB+) files are still not working for my Dropzone upload. I have previous code that someone else worked on, and that page is working for the same file I'm trying (2.94 GB), but I don't want to revert to the old code unless it's absolutely necessary as it's not as nice as Dropzone. So I know it's Dropzone or the code I'm using to save the file.

maxAllowedContentLength和maxRequestLength在我的web.config文件中设置;但是,大量(1.8 GB +)文件仍无法用于我的Dropzone上传。我有以前的代码,其他人工作,该页面正在尝试我正在尝试的相同文件(2.94 GB),但我不想恢复到旧代码,除非它是绝对必要的,因为它不如拖放区。所以我知道它是Dropzone或我用来保存文件的代码。

foreach (string s in Request.Files)
        {
            HttpPostedFile file = Request.Files[s];

            int fileSizeInBytes = file.ContentLength;
            string fileName = file.FileName;
            string fileExtension = file.ContentType;

            if (!string.IsNullOrEmpty(fileName))
            {
                string subDir = "asdf";
                fileExtension = Path.GetExtension(fileName);
                subDir = User.Identity.Name.Split('@')[0];
                fileName = Path.Combine(@"\\rocket\Assets\ftp\", subDir + "\\" + fileName);


                string checkExists = fileName;
                while (File.Exists(checkExists))
                {
                    // get the file name without the extension
                    string[] temp = checkExists.Split('.');
                    string fileNameNoExtention = temp[temp.Length - 2];

                    checkExists = fileNameNoExtention + DateTime.Now.Second.ToString() + fileExtension;
                }

                // IMPORTANT! Make sure to validate uploaded file contents, size, etc. to prevent scripts being uploaded into your web app directory
                file.SaveAs(checkExists);
                Session["fileUploaded"] = checkExists;
            }
        }

Is there something wrong with how I'm saving the file, or is Dropzone reaching a limitation?

我如何保存文件,或者Dropzone是否达到了限制,是否有问题?

1 个解决方案

#1


The dropzone is reaching its limit, i suggest to revert to your old codes as the dropzone cannot meet your needs if large files is what you want

dropzone正在达到极限,我建议恢复你的旧代码,因为如果大文件是你想要的,dropzone无法满足你的需求

#1


The dropzone is reaching its limit, i suggest to revert to your old codes as the dropzone cannot meet your needs if large files is what you want

dropzone正在达到极限,我建议恢复你的旧代码,因为如果大文件是你想要的,dropzone无法满足你的需求