-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathupload.php
More file actions
19 lines (16 loc) · 707 Bytes
/
Copy pathupload.php
File metadata and controls
19 lines (16 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
$uploaddir = getcwd() . '/audio/';
$uploadfile = $uploaddir . basename($_FILES['audiofile']['name']);
if (move_uploaded_file($_FILES['audiofile']['tmp_name'], $uploadfile)) {
header("Location: index.php");
} else {
$errorcode = $_FILES['audiofile']['error'];
switch ($errorcode) {
case 1: echo "File too big. Fix upload_max_filesize in your php.ini file."; break;
case 2: echo "File too big. Fix MAX_FILE_SIZE."; break;
case 3: echo "The file only uploaded partially. Maybe there's network trouble?"; break;
case 7: echo "Can't write file to disk. Check permissions."; break;
default: echo "Something went wrong with uploading the file (error code $errorcode). Sorry!"; break;
}
}
?>