![]() |
|
| |||||||
| Notices |
| Adding Elements To Your Website Discussions, help & troubleshooting about adding templates, backgrounds, images, text, iframes, scroll bars, marquees, flash, video, music, HTML Code, shapes, lines, java scripts, and all other elements. Etc… etc… |
![]() |
| | LinkBack | Thread Tools |
|
#1
| ||||
| ||||
| How can visitors simply click on a download link and have a box pop up automatically for them to rename and save the document to their computer without having to right click on the download link and click "Save Target As..."? I have seen this done on many sites but I don't know how they do it. I hope someone can help me. www.TannersSermons.com/sermons.html |
|
#2
| ||||
| ||||
| There are multiple ways of doing it. The easiest in my opinion is just adding some lines of code to your .htaccess file in the directory that contains the files you want your users to download example: Code: AddType application/octet-stream .avi AddType application/octet-stream .mpg AddType application/octet-stream .wmv AddType application/octet-stream .mp3 Hope that helps
__________________ Register/Login Script Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script |
|
#3
| ||||
| ||||
| Thanks for your response. I did everything according to your instructions (at least I think I did): I put the code AddType application/octet-stream .wma on the .htaccess file, which changed the pictures of all the wma files in that directory to a blue diamond image (so I guess I did something right), but on the site, the files still just open when I click on the download link, unstead of downloading. What did I do wrong? |
|
#4
| ||||
| ||||
| I don't know how your have your file structure setup, but it may be an issue with the paths to the files in relation to the .htaccess file. Try just adding it to the .htaccess file in your public_html directory. That should effect all other directories globally. If that doesn't work then there is way to do it with php, but if you have a bunch of files it would either mean creating a php file for each download you have, using an predefined list of files that can be downloaded and use url variables to choose which file, or to use a database to manage the files that will be downloaded.
__________________ Register/Login Script Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script |