我的Uploadify脚本适用于大多数小于10 MB的文件。但是,一旦文件大小开始超过40 MB,它将无法上传,只有一个错误消息“HTTP错误”。我试着为Uploadify实现onError处理程序,但它并没有给我提供任何具体的错误信息。该变量返回为“未定义”。我检查了我的web.config文件,并将文件大小限制设置为50 MB,并且我有30分钟的超时时间,所以我无法解决问题。这是我的脚本:Uploadify for ASP.NET应用程序为大文件返回HTTP错误
$('#uploader').uploadify({
'uploader': '/js/uploadify/uploadify.swf',
'script': '/cms/common/uploadify/UploadHandler.ashx',
'cancelImg': '/images/cancel_upload.png',
'buttonImg': '/images/select_video_thumbnail_en-us.gif',
'auto': true,
'folder': '/Temp',
'multi': false,
'sizeLimit': 0,
'displayData': 'percentage',
'simUploadLimit': 1,
'fileExt': '*.jpg;*.gif;*.png',
'fileDesc': '*.jpg;*.gif;*.png',
'buttonText': 'Select thumbnail...',
'width': '120',
'height': '24',
'onComplete': function (e, queueId, fileObj, response, data)
{
return true;
},
'onError': function (a, b, c, d)
{
if (d.status == 404)
alert('Could not find upload script.');
else if (d.type === "HTTP")
alert('error ' + d.type + ": " + d.status);
else if (d.type === "File Size")
alert(c.name + ' ' + d.type + ' Limit: ' + Math.round(d.sizeLimit/1024) + 'KB');
else
alert('error ' + d.type + ": " + d.text);
},
'onCancel': function (e, queueId, fileObj, data)
{
}
});
您是否尝试过使用调试器来查看发生了什么?我的第一个想法确实是maxRequestLength和RequestTimeout。顺便说一下,30分钟的超时会使超时无用,这太长了! (你确定它不是30秒?) – 2013-04-24 09:39:50
maxRequestLength = 50000,RequestTimeout = 30000. 30分钟不是不合理的。我尝试上传一个40 MB的文件,并花了将近12分钟使用DSL连接。有些用户的速度可能真的很慢,所以30分钟的时间就是安全的。另外,当系统使用频繁时,您需要包含系统时间。 – AndroidDev 2013-04-24 09:42:11
你是在本地运行还是在服务器上运行? – Serberuss 2013-04-24 09:43:46