Log in

View Full Version : download using php



nileshpatil
04-08-2014, 08:49 AM
hi.... i created one link that is <a href="#">download file</a>
if user click on download file then download window should come or file should start to download ...
so how can i do this ...

Beverleyh
04-08-2014, 02:54 PM
If you specifically want to force downloads of certain file types with PHP, have a look in to headers: https://www.google.co.uk/#q=php+headers+force+download

Alternatively (and usually easiest to guarantee getting around firewalls) is to just zip what ever you want to provide as a download. That should always prompt a download/save as dialogue window and you can keep using the standard hyperlink without any extra code.

fastsol1
04-12-2014, 01:26 PM
I have this tutorial on the subject.
http://amecms.com/article/PHP-Force-File-Download-With-File-Whitelist