Coldfusion上传http 302
我使用 uploadify v2.1.4 来进行 Coldfusion 上传多个文件。 中出现错误 http 302
$('#uploadfile').uploadify({
'uploader' : 'uploadify.swf',
'script' : './upload.cfm',
'cancelImg' : 'cancel.png',
'auto' : true,
'multi' : true,
'onError' : function(a, b, c, d) {
alert("Event: "+a+", QueueID: "+b+" FileInfo: "+c.name+", "+c.size+", "+c.creationDate+", "+c.modificationDate+", "+c.type+" Error: "+d.type+", "+d.info);
}
});
它在 IE 9 中运行良好,但在 Firefox 5和我的 upload.cfm
<cfscript>
thisPath = ExpandPath("*.*");
thisDirectory = GetDirectoryFromPath(thisPath);
FileDir = thisDirectory & "uploads/";
</cfscript>
<cffile action="upload" filefield="fileData" destination = "#FileDir#" nameconflict="makeunique" mode="777">
I was using uploadify v2.1.4 for my coldfusion upload multiple files. It worked well in IE 9 but occured an error http 302 in firefox 5
$('#uploadfile').uploadify({
'uploader' : 'uploadify.swf',
'script' : './upload.cfm',
'cancelImg' : 'cancel.png',
'auto' : true,
'multi' : true,
'onError' : function(a, b, c, d) {
alert("Event: "+a+", QueueID: "+b+" FileInfo: "+c.name+", "+c.size+", "+c.creationDate+", "+c.modificationDate+", "+c.type+" Error: "+d.type+", "+d.info);
}
});
and my upload.cfm
<cfscript>
thisPath = ExpandPath("*.*");
thisDirectory = GetDirectoryFromPath(thisPath);
FileDir = thisDirectory & "uploads/";
</cfscript>
<cffile action="upload" filefield="fileData" destination = "#FileDir#" nameconflict="makeunique" mode="777">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您使用 uploadify 时,它会将请求从 flash 播放器发送到 upload.cfm 文件。不幸的是,它并不总是将会话详细信息发送到 upload.cfm 文件,因此如果您有任何可能阻止请求的身份验证,那么您将收到错误。
验证您的上传文件前面没有任何身份验证机制(并且您没有执行 cflocation,正如 Jason 提到的)。如果这样做,那么您需要手动将身份验证凭据传递到上传表单,或者从该文件中删除身份验证要求。我通常使用 Uploadify 的 scriptData 属性将详细信息发送到我的上传脚本。
When you're using uploadify, it will send a request from the flash player to the upload.cfm file. Unfortunately, it doesn't always send the session details to the upload.cfm file, so if you have any sort of authentication that could be blocking the request, then you'll get an error.
Verify that you don't have any authentication mechanisms in front of your upload file (and that you're not doing a cflocation, as Jason mentioned). If you do, then you'll either need to manually pass authentication credentials to your upload form, or remove the authentication requirements from that file. I usually use the scriptData property for Uploadify to send the details along to my upload script.