简体   繁体   English

coldfusion 上传 http 302

[英]coldfusion uploadify http 302

I was using uploadify v2.1.4 for my coldfusion upload multiple files.我正在使用 uploadify v2.1.4 为我的 coldfusion 上传多个文件。 It worked well in IE 9 but occured an error http 302 in firefox 5它在 IE 9 中运行良好,但在 firefox 5 中出现错误 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);
    }
});

and my upload.cfm和我的upload.cfm

<cfscript>
    thisPath = ExpandPath("*.*");
    thisDirectory = GetDirectoryFromPath(thisPath);
    FileDir = thisDirectory & "uploads/";
</cfscript>

<cffile action="upload" filefield="fileData" destination = "#FileDir#" nameconflict="makeunique" mode="777">

When you're using uploadify, it will send a request from the flash player to the upload.cfm file.当您使用uploadify 时,它会从flash 播放器向upload.cfm 文件发送请求。 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.不幸的是,它并不总是将 session 详细信息发送到 upload.cfm 文件,因此如果您有任何可能阻止请求的身份验证,那么您将收到错误消息。

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).确认您在上传文件之前没有任何身份验证机制(并且您没有执行 cflocation,正如 Jason 所提到的)。 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.我通常使用 Uploadify 的scriptData属性将详细信息发送到我的上传脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM