| @@ 66-69 (lines=4) @@ | ||
| 63 | $_course = api_get_course_info(); |
|
| 64 | $_user = api_get_user_info(); |
|
| 65 | //Check if the file is valid (not to big and exists) |
|
| 66 | if (!isset ($_FILES['userFile']) || !is_uploaded_file($_FILES['userFile']['tmp_name'])) { |
|
| 67 | // upload failed |
|
| 68 | return false; |
|
| 69 | } |
|
| 70 | if (preg_match('/.zip$/i', $_FILES['userFile']['name']) && handle_uploaded_document($_course, $_FILES['userFile'], $baseWorkDir, $uploadPath, $_user['user_id'], 0, null, 1, 'overwrite', false)) { |
|
| 71 | if (!function_exists('gzopen')) { |
|
| 72 | return false; |
|
| @@ 43-46 (lines=4) @@ | ||
| 40 | $_user = api_get_user_info(); |
|
| 41 | ||
| 42 | //Check if the file is valid (not to big and exists) |
|
| 43 | if (!isset($_FILES['userFile']) || !is_uploaded_file($_FILES['userFile']['tmp_name'])) { |
|
| 44 | // upload failed |
|
| 45 | return false; |
|
| 46 | } |
|
| 47 | ||
| 48 | if (preg_match('/.zip$/i', $_FILES['userFile']['name']) && |
|
| 49 | handle_uploaded_document( |
|