prasathmani / tinyfilemanager

Single-file PHP file manager, browser and manage your files efficiently and easily with tinyfilemanager
https://tinyfilemanager.github.io
GNU General Public License v3.0
4.85k stars 1.66k forks source link

Upload from URL error #760

Open crispa opened 2 years ago

crispa commented 2 years ago

Hi everyone, I love Tinyfilamager, Thank you! I have a problem after upload image from URL:

prasathmani commented 2 years ago

mostly this will issue occur when you change the $root_path configuration, please make sure you change $root_url as well.

crispa commented 2 years ago

Thank you for your reply. I tried many options but don't work. Only when upload from URL persmissions was seted 0600...

crispa commented 2 years ago

No any update about this problem??

informas commented 1 year ago

I have the same problem. I saw that when we "Upload from URL" the file permissions are set to "600" and TFM require "0604" to show the file or enable access,

RavanH commented 7 months ago

Hi all, it is because Tiny File Manager uses tempnam() to create the temporary file. This function creates a file with 600 permissions by default.

This can be fixed by adding a chmod to the success block that starts on line 650 so it looks like this:

if ($success) {
    chmod($temp_file, 0644);
    $success = rename($temp_file, strtok(get_file_path(), '?'));
}