[GH-ISSUE #819] file upload - says "success" on failure #553

Closed
opened 2026-03-02 15:59:43 +03:00 by kerem · 1 comment
Owner

Originally created by @mclorch on GitHub (Jul 15, 2022).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/819

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.

Originally created by @mclorch on GitHub (Jul 15, 2022). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/819 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.
kerem closed this issue 2026-03-02 15:59:43 +03:00
Author
Owner

@prasathmani commented on GitHub (Nov 19, 2022):

This issue is addressed in the new release.

<!-- gh-comment-id:1320958906 --> @prasathmani commented on GitHub (Nov 19, 2022): This issue is addressed in the new [release](https://github.com/prasathmani/tinyfilemanager/releases/tag/2.5.0).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tinyfilemanager#553
No description provided.