【发布时间】:2016-02-05 15:09:40
【问题描述】:
我正在做一个 asp.net 网络表单项目并尝试实现 jQuery 文件上传。我能够让它处理较小的文件,但不会上传超过 30mb 的文件。进度条会出现,然后就停留在开头,如下所示:
在我的 web.config 中,我设置了最大请求长度和最大允许内容长度。
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" maxRequestLength="10240000" executionTimeout="1800" />
</system.web>
和
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="4248576000" />
</requestFiltering>
</security>
</system.webServer>
我可以通过设置 maxChunkSize: 10000000 来解决这个问题,但是当我这样做时,我的 asp.net 没有正确附加文件。它只会保存最后一个块,否则它会锁定并说“该进程无法访问该文件,因为它正在被另一个进程使用。”
我正在使用文档中此示例中的 FileTransferHandler: https://github.com/i-e-b/jQueryFileUpload.Net/blob/master/jQueryFileUpload/FileTransferHandler.ashx.cs
【问题讨论】:
标签: jquery asp.net file-upload jquery-file-upload blueimp