Coldfusion上传http 302

发布于 2024-11-29 07:10:03 字数 827 浏览 0 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

后知后觉 2024-12-06 07:10:03

当您使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文