我正在使用Uploadify,现在以前工作的东西不是,我不知道为什么.每当我点击上传时,我都会收到HTTP错误.在Firefox中观看网络标签,看起来甚至不再向服务器发送任何内容.
我已经尝试输入错误函数来帮助调试但是status属性是未定义的..
$("#fileInput").uploadify({
'uploader': '/scripts/upload/uploadify.swf',
'script': '/Member/UploadImages/PerformUpload',
'cancelImg': '/scripts/upload/cancel.png',
'multi': true,
'simUploadLimit': 1,
'fileDesc': "Images",
'fileExt': "*.jpg;*. jpeg;*.bmp;*.png",
'sizeLimit': 3000000,
'onAllComplete':showFinishedLink,
'onError': function (event, queueID ,fileObj, errorObj) {
var msg;
if (errorObj.status == 404) {
alert('Could not find upload script. Use a path relative to: '+'<?= getcwd() ?>');
msg = 'Could not find upload script.';
} else if (errorObj.type === "HTTP")
msg = errorObj.type+": "+errorObj.status;
else if (errorObj.type ==="File Size")
msg = fileObj.name+'<br>'+errorObj.type+' Limit: '+Math.round(errorObj.sizeLimit/1024)+'KB';
else
msg = errorObj.type+": "+errorObj.text;
alert(msg);
$("#fileUpload" + queueID).fadeOut(250, function() { $("#fileUpload" + queueID).remove()});
return false;
},
});
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
好吧,想通了我正在使用的错误调试是旧的,我可以说errorObj.info来获取更详细的信息,说明它为什么不起作用.
这样做并且结果是404这意味着我尝试POST的脚本即使它确实存在也没有被接收.听起来像路由问题......
案件结案!
只是为了添加更多信息 - 404是web.config文件中旧的默认登录URL的结果.
一旦我解决了这个问题,404就会成为302(查看IIS日志),因为该网站正在将我重定向到登录页面.
我的上传脚本位于网站的经过身份验证的区域,因此我需要使用此网站中描述的内容
| 归档时间: |
|
| 查看次数: |
28109 次 |
| 最近记录: |