View Full Version : download the file instead of opening it
08-01-2010, 03:22 AM
hey guys need help here
i want to make the user download the file txt pdf whatever instead of open the content
thankss a lot!
08-01-2010, 12:18 PM
I don't know any code to set the link to either open or download.... But what you could do if that helps, is placing all files into a .rar or .zip file. Then, the browser will ask by default what they wanna do, open or download. Does that help or work for you? I can look if I can get another solution if you like.
08-01-2010, 03:30 PM
I`m sorry but i need to downloa the file itself like .txt .*** .mp4 .mkv
i'd be glad if you could help me please!
08-01-2010, 03:41 PM
If your server is apache, then add the following into your htaccess file
AddType application/octet-stream .pdf .txt .mp4
08-01-2010, 04:10 PM
You have to zip the file to trigger the browser's response to Save File. Otherwise, it will call a program to play the media file.
How to Zip or Unzip a file:
Making an image a link:
<p><a href="URL path to zipped file" title="Mouseover Description"><img style="width: XXpx; height: YYpx; border: 0;" src="Path to image" alt="Text Description"></a></p>
Text Link only:
<p><a href="URL path to zipped file" title="Mouseover Description">Link Text Description</a></p>
You can change the "p" tags to div tags and style as needed.
Forcing File Downloads in PHP: http://elouai.com/force-download.php
Using PHP Headers to Force Download: http://www.ryboe.com/tutorials/php-headers-force-download
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.