mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-25 07:28:40 +00:00
commit
87749adb28
@ -50,7 +50,7 @@
|
|||||||
becomeMsgPage('<div>' . $errmsg . '</div><a href="/problem/'.$problem['id'].'/manage/data">返回</a>');
|
becomeMsgPage('<div>' . $errmsg . '</div><a href="/problem/'.$problem['id'].'/manage/data">返回</a>');
|
||||||
} else {
|
} else {
|
||||||
$zip_mime_types = array('application/zip', 'application/x-zip', 'application/x-zip-compressed');
|
$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";
|
$up_filename="/tmp/".rand(0,100000000)."data.zip";
|
||||||
move_uploaded_file($_FILES["problem_data_file"]["tmp_name"], $up_filename);
|
move_uploaded_file($_FILES["problem_data_file"]["tmp_name"], $up_filename);
|
||||||
$zip = new ZipArchive;
|
$zip = new ZipArchive;
|
||||||
|
Loading…
Reference in New Issue
Block a user