fixed error codes

This commit is contained in:
nokonoko 2020-11-18 15:05:26 +01:00
parent 95b5e1a7b6
commit 7545367000

View File

@ -105,6 +105,7 @@ function uploadFile($file)
// Attempt to move it to the static directory
if (!move_uploaded_file($file->tempfile, $uploadFile)) {
http_response_code(500);
throw new Exception(
'Failed to move file to destination',
500
@ -113,6 +114,7 @@ function uploadFile($file)
// Need to change permissions for the new file to make it world readable
if (!chmod($uploadFile, 0644)) {
http_response_code(500);
throw new Exception(
'Failed to change file permissions',
500