gpt4 book ai didi

javascript - igUpload 上传大文件失败

转载 作者:行者123 更新时间:2023-11-30 09:40:32 27 4
gpt4 key购买 nike

我正在使用 Infragistics 的 igUpload 上传多个文件。当文件大小小于 3 MB 时一切正常,但是当我尝试上传更大的文件时,它失败并返回此错误

Could not get your current file status! Probably connection dropped

我还将 uploadUtilsBufferSize 更改为 10485760,但仍然无法处理更大的文件。以下是igUplaod的配置

Button.igUpload({
mode: 'multiple',
multipleFiles: true,
AutoStartUpload: false,
progressUrl: "IGUploadStatusHandler.ashx",
controlId: "upload1",
labelUploadButton: "Upload",
onError: function(evt, ui) {
if (ui.errorType == "serverside") {
ErrorMessage.append("<p>" + ui.serverMessage + "</p>");
} else if (ui.errorType == "clientside") {
ErrorMessage.append("<p>" + ui.errorMessage + "</p>");
}
}
});

最佳答案

IIS 网络服务器上有最大请求长度限制。对于 IIS 6,它是 4 MB(详情 here)。 IIS 7 及更新版本为 28.6 MB(详情 here)。

根据您使用的 IIS 版本,尝试在 web.config 中进行以下设置:

IIS 6(网络配置):

<system.web>
<httpHandlers>
<add verb="GET" type="Infragistics.Web.Mvc.UploadStatusHandler"
path="IGUploadStatusHandler.ashx" />
</httpHandlers>
<httpModules>
<add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule" />
</httpModules>
<!--OPTIONAL: Set the maximum request length.
By default the request lenght is 4 MB.
More info: http://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx-->
<httpRuntime executionTimeout="3600" maxRequestLength="2097151000"/>
</system.web>

IIS 7(及更高版本)(web.config):

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule"
preCondition="managedHandler" />
</modules>
<handlers>
<add name="IGUploadStatusHandler" path="IGUploadStatusHandler.ashx" verb="*"
type="Infragistics.Web.Mvc.UploadStatusHandler" preCondition="integratedMode" />
</handlers>
<security>
<requestFiltering>
<!--OPTIONAL: Set the maximum request length.
By default the request lenght is ~30 MB.
More info: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits-->
<requestLimits maxAllowedContentLength="2097151000"/>
</requestFiltering>
</security>
</system.webServer>

P.S.:此信息记录在 Ignite UI 帮助中 here .

关于javascript - igUpload 上传大文件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41342178/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com