簡體   English   中英

coldfusion 上傳 http 302

[英]coldfusion uploadify http 302

我正在使用 uploadify v2.1.4 為我的 coldfusion 上傳多個文件。 它在 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);
    }
});

和我的upload.cfm

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

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

當您使用uploadify 時,它會從flash 播放器向upload.cfm 文件發送請求。 不幸的是,它並不總是將 session 詳細信息發送到 upload.cfm 文件,因此如果您有任何可能阻止請求的身份驗證,那么您將收到錯誤消息。

確認您在上傳文件之前沒有任何身份驗證機制(並且您沒有執行 cflocation,正如 Jason 所提到的)。 如果這樣做,那么您將需要手動將身份驗證憑據傳遞給您的上傳表單,或者從該文件中刪除身份驗證要求。 我通常使用 Uploadify 的scriptData屬性將詳細信息發送到我的上傳腳本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM