0

I have problem with chmod on my server. For client I build security link for download file like:

mydomain.com/download/123

It work ok, function download use file_get_content and header and it's works, but when I open link for example:

mydomain.com/upload/somefolder/somefile.jpg

This file view too :(

what chmod I must set on folder upload to block link direct and allow to download via header() file_get_content() ?

bradley546994
  • 630
  • 2
  • 12
  • 30
  • Possible duplicate of http://stackoverflow.com/questions/10473932/browser-html-force-download-of-image-from-src-dataimage-jpegbase64 – Aus Nov 18 '16 at 09:12
  • 1
    no chmod whatsoever - because if your webserver can't access it, your webserver can't access it, so your script fails, too. you should instead move your upload folder outside of the document root to make access impossible or secure it with a .htaccess-file to disallow access. – Franz Gleichmann Nov 18 '16 at 09:19
  • you are the best, thanks ;) – bradley546994 Nov 18 '16 at 09:35

0 Answers0