简体   繁体   中英

coldfusion uploadify http 302

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">

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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