I have a pdf directory where all the pdf's are chmod 640.
It's set this way so that people can't access the pdfs directly like this.
Example: www.mydomain.com/pdf/pdf.pdf
I have a php download script in the pdf directory to download the files, but it doesn't work with chmod 640.
I get the following error:
[function.fopen]: failed to open stream: Permission denied
I'm assuming i need the script to run as the owner or group but can't figure how to do it.
Any suggestions?
Thanks in advance.
~D
php script to download pdf files
Moderator: General Moderators
-
djdavedawson
- Forum Newbie
- Posts: 9
- Joined: Tue Jul 29, 2008 10:13 am
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: php script to download pdf files
why not place the pdf files outside the web root, so they cannot be directly accessed? Then you can assign the required permissions to stream the files with php.
-
djdavedawson
- Forum Newbie
- Posts: 9
- Joined: Tue Jul 29, 2008 10:13 am
Re: php script to download pdf files
This worked great !
Is doing this an accepted practice?
Thanks Again !!
Is doing this an accepted practice?
Thanks Again !!
- flying_circus
- Forum Regular
- Posts: 732
- Joined: Wed Mar 05, 2008 10:23 pm
- Location: Sunriver, OR
Re: php script to download pdf files
Sure, I put everything I can outside of the document root.