mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-23 07:51:53 +00:00
解决火狐浏览器上传数据“请上传zip格式!”问题
This commit is contained in:
parent
8692ff11a7
commit
d38b9115c5
@ -50,7 +50,7 @@
|
||||
becomeMsgPage('<div>' . $errmsg . '</div><a href="/problem/'.$problem['id'].'/manage/data">返回</a>');
|
||||
} else {
|
||||
$zip_mime_types = array('application/zip', 'application/x-zip', 'application/x-zip-compressed');
|
||||
if (in_array($_FILES["problem_data_file"]["type"], $zip_mime_types)) {
|
||||
if (in_array($_FILES["problem_data_file"]["type"], $zip_mime_types) || $_FILES["problem_data_file"]["type"] == 'application/octet-stream' && substr($_FILES["problem_data_file"]["name"], -4) == '.zip') {
|
||||
$up_filename="/tmp/".rand(0,100000000)."data.zip";
|
||||
move_uploaded_file($_FILES["problem_data_file"]["tmp_name"], $up_filename);
|
||||
$zip = new ZipArchive;
|
||||
|
Loading…
Reference in New Issue
Block a user