projects
/
pics.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "error handling"TM
[pics.git]
/
upload.php
diff --git
a/upload.php
b/upload.php
index
295f420
..
735f96a
100644
(file)
--- a/
upload.php
+++ b/
upload.php
@@
-17,6
+17,10
@@
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$mime_type = $images['type'][$i];
$tmp_file = $images['tmp_name'][$i];
$error = $images['error'][$i];
$mime_type = $images['type'][$i];
$tmp_file = $images['tmp_name'][$i];
$error = $images['error'][$i];
+ if($error != '0') {
+ http_response_code(400);
+ die('Upload error');
+ }
$size = $images['size'][$i];
// strip EXIF
$img = new Imagick($tmp_file);
$size = $images['size'][$i];
// strip EXIF
$img = new Imagick($tmp_file);