Forum Moderators: phranque

Message Too Old, No Replies

How to force dowload of ALL files?

         

cyphix

5:27 pm on Dec 31, 2005 (gmt 0)

10+ Year Member



Hey guys... is there a way via .htaccess that I can force the download of ever filetype? Yes.. even .php, .html, .jpg, .gif etc etc....

I searched google but didn't have much luck. :(

Cheers!

cws3di

5:44 pm on Dec 31, 2005 (gmt 0)

10+ Year Member




You need to explain what you are asking? "force the download" is not terminology that I have ever heard before...

.

encyclo

6:53 pm on Dec 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are all the files in the same directory? If so, how about using
ForceType
:

[httpd.apache.org...]

Something like:

<Directory /home/username/public_html/download>
ForceType application/octet-stream
</Directory>

cyphix

7:03 pm on Dec 31, 2005 (gmt 0)

10+ Year Member



You need to explain what you are asking? "force the download" is not terminology that I have ever heard before...

What I mean is the web browser won't display anything; like if someone went to view a image, text or php file for example.. it will prompt them with a download box just like it would for a zip file etc..

Enycyclo... they are not exactly all in the same directory; however they will all be inside subdirectories of the same directory such as..

MainDir/
-> Files1/
-> Files2/
-> Files3/
etc..

Thanks guys!

cyphix

7:17 pm on Dec 31, 2005 (gmt 0)

10+ Year Member



Hmmm.... I tried that in my .htaccess file with one of the folders that has files in it & all I got was a 500 error :(

jdMorgan

10:30 pm on Dec 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A quick check of the Apache documentation [httpd.apache.org] will reveal that <Directory> containers cannot be used in an .htaccess context. Just remove the container from around the code and try again.

Jim

cyphix

4:31 am on Jan 1, 2006 (gmt 0)

10+ Year Member



You mean just like this..

"ForceType application/octet-stream" (without the quotes)

If so, I tried that & it didn't have any effect on anything...