您好,欢迎访问一九零五行业门户网

关于uploadify插件在火狐浏览器的兼容问题!!!

uploadify 插件在谷歌上一切都ok
但是在火狐上一直报302错误
网上找了一大把资料 模糊的意思是在火狐上服务器端要判断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 插件在谷歌上一切都ok
但是在火狐上一直报302错误
网上找了一大把资料 模糊的意思是在火狐上服务器端要判断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重写一样。
其它类似信息

推荐信息