tinyfilemanager icon indicating copy to clipboard operation
tinyfilemanager copied to clipboard

Upload from URL error

Open crispa opened this issue 2 years ago • 5 comments

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

  • Preview thumbnail doesn't work
  • Direct Link doesn't work, I get Forbidden error But image file exists in my storage... Upload from URL was set to permission 0600 and upload image from file is set 0644, it's a problem about permissions?

crispa avatar Mar 26 '22 09:03 crispa

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

prasathmani avatar Mar 28 '22 04:03 prasathmani

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

crispa avatar Mar 28 '22 09:03 crispa

No any update about this problem??

crispa avatar Apr 04 '22 21:04 crispa

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,

informas avatar Jun 28 '23 15:06 informas

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(), '?'));
}

RavanH avatar Feb 06 '24 14:02 RavanH