tinyfilemanager
tinyfilemanager copied to clipboard
file upload - says "success" on failure
I encountered a situation during file upload, where the file got created but not populated.
To accurately detect this error, the success response object should be relocated inside of the if statement checking if the tmp file is readable (line 928):
if ($out) {
$in = @fopen($tmp_name, "rb");
if ($in) {
while ($buff = fread($in, 4096)) { fwrite($out, $buff); }
// TODO - CREATE SUCCESS RESPONSE OBJ HERE INSTEAD!
It would also be nice to provide some more troubleshooting information, e.g. by logging the last error that occurred in case of error.