【问题标题】:Why is Dropzone Failing for Large Uploads?为什么 Dropzone 无法进行大型上传?
【发布时间】:2015-07-14 02:25:20
【问题描述】:

maxAllowedContentLengthmaxRequestLength 在我的 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;
            }
        }

我保存文件的方式有问题,还是 Dropzone 达到了限制?

【问题讨论】:

    标签: c# asp.net file-upload dropzone.js


    【解决方案1】:

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

    【讨论】:

    • 这根本不是真的。
    • 也没有帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-04-08
    • 1970-01-01
    • 2018-07-11
    • 1970-01-01
    • 2016-06-22
    • 1970-01-01
    • 2014-11-10
    相关资源
    最近更新 更多