Stop a file being downloaded

dandyman1

New Member
Messages
2
Reaction score
0
Points
0
Hi,

I want my php scripts to be able to access some text files. However I do not want these text files being downloaded by the user. Is it possible to run save text files somewhere where they can't be downloaded?

Thanks for your help
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
On x10hosting, your personal file system starts at /home/igor , where igor is your cPanel username.

Your Document Root, the files that are directly accessible via the web, starts at /home/igor/public_html

A PHP script can access any file on your personal file system.

So, if you want to have files accessible by scripts but not directly via the web, create a directory, /home/igor/includes , and place the files there. When you require them in your PHP script, remember to use the absolute path.

Alternatively, you can put them in a directory, /home/igor/public_html/includes , and then password-protect the directory.
 
Last edited:
Top