Skip to content
Snippets Groups Projects
Commit b129079b authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

show error code if file upload fails

parent da5d3882
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,8 @@ and $_SESSION['username'] and strpos($dir,'..') === false){
}
}
echo json_encode(array( "status" => "error"));
$error = $_FILES['file']['error'];
echo json_encode(array( 'status' => 'error', 'data' => array('error' => $error)));
?>
......@@ -53,7 +53,7 @@ function uploadFinished() {
result = $('#file_upload_target').contents().text();
result = eval("(" + result + ");");
if(result.status == "error") {
alert('An error occcured, upload failed.');
alert('An error occcured, upload failed.\nError code: ' + result.data.error);
} else {
location.href = 'index.php?dir=' + $('#dir').val();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment