fixed error codes
This commit is contained in:
parent
95b5e1a7b6
commit
7545367000
1 changed files with 2 additions and 0 deletions
|
@ -105,6 +105,7 @@ function uploadFile($file)
|
||||||
|
|
||||||
// Attempt to move it to the static directory
|
// Attempt to move it to the static directory
|
||||||
if (!move_uploaded_file($file->tempfile, $uploadFile)) {
|
if (!move_uploaded_file($file->tempfile, $uploadFile)) {
|
||||||
|
http_response_code(500);
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
'Failed to move file to destination',
|
'Failed to move file to destination',
|
||||||
500
|
500
|
||||||
|
@ -113,6 +114,7 @@ function uploadFile($file)
|
||||||
|
|
||||||
// Need to change permissions for the new file to make it world readable
|
// Need to change permissions for the new file to make it world readable
|
||||||
if (!chmod($uploadFile, 0644)) {
|
if (!chmod($uploadFile, 0644)) {
|
||||||
|
http_response_code(500);
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
'Failed to change file permissions',
|
'Failed to change file permissions',
|
||||||
500
|
500
|
||||||
|
|
Loading…
Reference in a new issue