Re: Problems downloading a PDF
| From: | Richard Davey | Date: | Wed, 04 Apr 2007 12:10:20 +0000 |
| Subject: | Re: Problems downloading a PDF | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252028@lists.php.net to get a copy of this message | ||
Mário Gamito wrote:
To prevent people to insert the full URL to the documents, i moved them outside Apache's DocumentRooot, which is /var/www. My site is in /var/www/telbit and i put the PDFs in /var/www I've coded in order to do the trick, but it's failing. I can't get the name of the file.You don't need to basename() it, you already know what the filename is, because it was requested via $_GET['file']. I would insert a file_exist check before you try and send it. It might give you the cause of your problem. Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk "Never trust a computer you can't throw out of a window"