[GH-ISSUE #55] Associate logged username with uploaded file #37

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

Originally created by @rclabs-dev on GitHub (Aug 17, 2018).
Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/55

Hi dear,

Very nice application. Is possible to add a feature to associate logged username with uploaded file.

Thanks in advance.

Sincerely,

Regivaldo Costa

Originally created by @rclabs-dev on GitHub (Aug 17, 2018). Original GitHub issue: https://github.com/prasathmani/tinyfilemanager/issues/55 Hi dear, Very nice application. Is possible to add a feature to associate logged username with uploaded file. Thanks in advance. Sincerely, Regivaldo Costa --
kerem 2026-03-02 15:55:11 +03:00
Author
Owner

@prasathmani commented on GitHub (Aug 24, 2018):

Replace following code in Line number start: 464

    $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true;

    $temp = explode(".", $_FILES["file"]["name"]);
    $newfilename = pathinfo($filename)['filename'].'-'.$_SESSION['logged']. '.' . end($temp);

    if (empty($f['file']['error']) && !empty($tmp_name) && $tmp_name != 'none' && $isFileAllowed) {
        if (move_uploaded_file($tmp_name, $path . '/' . $newfilename)) {
            die('Successfully uploaded');
        } else {
            die(sprintf('Error while uploading files. Uploaded files: %s', $uploads));
        }
    }
<!-- gh-comment-id:415707068 --> @prasathmani commented on GitHub (Aug 24, 2018): Replace following code in Line number start: 464 ``` $isFileAllowed = ($allowed) ? in_array($ext, $allowed) : true; $temp = explode(".", $_FILES["file"]["name"]); $newfilename = pathinfo($filename)['filename'].'-'.$_SESSION['logged']. '.' . end($temp); if (empty($f['file']['error']) && !empty($tmp_name) && $tmp_name != 'none' && $isFileAllowed) { if (move_uploaded_file($tmp_name, $path . '/' . $newfilename)) { die('Successfully uploaded'); } else { die(sprintf('Error while uploading files. Uploaded files: %s', $uploads)); } } ```
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#37
No description provided.