show error code if file upload fails
This commit is contained in:
parent
da5d388266
commit
b129079bed
2 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue