![]() |
| Sponsored Links (We share ad revenue): |
|
|
Re: allow download of files from website. |
|
Weightlifting CS Student
Posts: 451
Name: Nick Ohrn
|
I wouldn't suggest linking directly to a publicly accessible file. If you do that, people you don't want to have access to the file might get access to it. What I would do is place the PPT file outside of your web root and read it in after verifying they were referred after filling in the form. Make sure you send the appropriate header from the page.
PHP Code:
__________________
NickOhrn.com - My personal haven of insight to offer the world. Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others. |
|
|
|
|
|
Re: allow download of files from website. |
|
Experienced Talker
Posts: 35
Location: kalamazoo
|
If you will forgive a newbie mistake, where exactly is outside my web root directory?
|
|
|
|
|
|
Re: allow download of files from website. |
|
Skilled Talker
Posts: 97
Name: Chris Duerr
|
Anywhere. If you have a folder called 'public_html' or 'www'.. just make sure it's not within that folder. Your ftp folder is probably fine. Alternatively, you could just create a folder in your standard public_html folder and place an .htaccess file in it to restrict access. (http://httpd.apache.org/docs/1.3/howto/htaccess.html for your reference)
Use Nick's code to allow users to view the file -- you'll have to figure out authentication though first if it matters, which I assume it does ![]() Also, if you want to force a download screen: PHP Code:
__________________
Chris Duerr AddonChat Java Chat Software http://www.addonchat.com/ - Affiliate Program |
|
|
|
| Sponsored Links (We share ad revenue): |
| Thread Tools | |
|
|
| Webmaster Resources Marketplace: |
| Software Development Company | Webhosting.UK.com |
| Web Templates | Text Link Brokers | Stock Photos |