From: Jacob Casper Date: Sat, 9 Apr 2022 21:14:16 +0000 (-0500) Subject: Add "error handling"TM X-Git-Url: https://git.jacobcasper.com/?p=pics.git;a=commitdiff_plain;h=3220d3ad5b10291371fa7e27a52b203eeeee0309 Add "error handling"TM don't actually handle anything but at least set a header and display something for me. I kept hitting php_ini_maxfilesize errors. --- diff --git a/upload.php b/upload.php index 295f420..735f96a 100644 --- 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]; + if($error != '0') { + http_response_code(400); + die('Upload error'); + } $size = $images['size'][$i]; // strip EXIF $img = new Imagick($tmp_file);