關於uploadify外掛程式在Firefox瀏覽器的相容問題!!!

來源:互聯網
上載者:User
關鍵字 php jquery ci
uploadify 外掛程式在Google上一切都ok
但是在Firefox上一直報 302錯誤
網上找了一大把資料 模糊的意思是在 Firefox上伺服器端要判斷session的值 因為前端沒有發過來 所以會驗證失敗 導致重新導向 可是具體如何操作的?

針對PHP的具體辦法是什嗎?
求回答相關話題,無關緊要或沒意義的回帖我會踩你,謝謝!

/*以下是用戶端代碼*/ ____________分割線______________/*以下是服務端代碼*/public function uploadify() {        $type = $_GET['type'];        $targetPath = './uploads/uploadify_file';         $verifyToken = md5('unique_salt' . $_POST['timestamp']);        if (!empty($_FILES) && $_POST['token'] == $verifyToken) {            $tempFile = $_FILES['Filedata']['tmp_name'];            if (!file_exists($targetPath)) {                @mkdir($targetPath);                chmod($targetPath, 0777);            }            $file_name = $_FILES['Filedata']['name'];            $hz = explode(".",$_FILES['Filedata']['name']);            $targetFile = rtrim($targetPath,'/') . '/' . md5(time()).".".$hz[1];            // Validate the file type            $fileTypes = array('doc','docx','pdf'); // File extensions            $fileParts = pathinfo($_FILES['Filedata']['name']);            if (in_array($fileParts['extension'],$fileTypes)) {                if(move_uploaded_file($tempFile,$targetFile)){                    $file_message = array(                        'file_name'=>$file_name,                        'file_creat_time'=>time(),                        'file_url'=> $targetFile,                        'file_type'=>$type                        );                    $res = $this->files_Model->insert($file_message);                    if (!$res) {                        echo '檔案'.$file_message['name'].'儲存失敗';                        return FALSE;                    }else{                        echo '上傳成功';                        return TRUE;                    }                }else{                    echo '啊哦!檔案移動失敗了,請檢查檔案路徑';                    return FALSE;                }            } else {                echo '檔案類型不匹配哈!';                return FALSE;            }        }    }

回複內容:

uploadify 外掛程式在Google上一切都ok
但是在Firefox上一直報302錯誤
網上找了一大把資料 模糊的意思是在Firefox上伺服器端要判斷session的值 因為前端沒有發過來 所以會驗證失敗 導致重新導向 可是具體如何操作的?

針對PHP的具體辦法是什嗎?
求回答相關話題,無關緊要或沒意義的回帖我會踩你,謝謝!

/*以下是用戶端代碼*/ ____________分割線______________/*以下是服務端代碼*/public function uploadify() {        $type = $_GET['type'];        $targetPath = './uploads/uploadify_file';         $verifyToken = md5('unique_salt' . $_POST['timestamp']);        if (!empty($_FILES) && $_POST['token'] == $verifyToken) {            $tempFile = $_FILES['Filedata']['tmp_name'];            if (!file_exists($targetPath)) {                @mkdir($targetPath);                chmod($targetPath, 0777);            }            $file_name = $_FILES['Filedata']['name'];            $hz = explode(".",$_FILES['Filedata']['name']);            $targetFile = rtrim($targetPath,'/') . '/' . md5(time()).".".$hz[1];            // Validate the file type            $fileTypes = array('doc','docx','pdf'); // File extensions            $fileParts = pathinfo($_FILES['Filedata']['name']);            if (in_array($fileParts['extension'],$fileTypes)) {                if(move_uploaded_file($tempFile,$targetFile)){                    $file_message = array(                        'file_name'=>$file_name,                        'file_creat_time'=>time(),                        'file_url'=> $targetFile,                        'file_type'=>$type                        );                    $res = $this->files_Model->insert($file_message);                    if (!$res) {                        echo '檔案'.$file_message['name'].'儲存失敗';                        return FALSE;                    }else{                        echo '上傳成功';                        return TRUE;                    }                }else{                    echo '啊哦!檔案移動失敗了,請檢查檔案路徑';                    return FALSE;                }            } else {                echo '檔案類型不匹配哈!';                return FALSE;            }        }    }

首先,我是JAVA開發,但是這個問題本質跟語言無關

問題是session丟失的問題,那麼你需要在請求的時候帶上JSONID傳過去,就像使用者瀏覽器禁用cookie的url重寫一樣。

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.