Protect online files

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
moussa854
Forum Newbie
Posts: 23
Joined: Thu Apr 30, 2009 4:10 pm

Protect online files

Post by moussa854 »

I need to protect my files from any download. I know that some software can download the whole website. In case this happen to my website, I need to protect the files in folder "X". What is the best way to do this? Thanks in advance.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Protect online files

Post by jackpf »

Put them outside your public html dir.

Or, put a htaccess file with:

Code: Select all

deny from all
moussa854
Forum Newbie
Posts: 23
Joined: Thu Apr 30, 2009 4:10 pm

Re: Protect online files

Post by moussa854 »

I need to upload and download files from this folder
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Protect online files

Post by jackpf »

You can use php to upload and download. It doesn't use the HTTP protocol with local files so it doesn't matter.
moussa854
Forum Newbie
Posts: 23
Joined: Thu Apr 30, 2009 4:10 pm

Re: Protect online files

Post by moussa854 »

Thanks
Post Reply