how to force file download?
-
i have a static html page. i have a link in it to download a pdf file. i want to force download the file, not to open it, when user click on it. but if user had installed acrobotreader in his/her pc, my link open the file directly. but i dont want to act so. i want file to be downloaded. thanks rastgar
-
i have a static html page. i have a link in it to download a pdf file. i want to force download the file, not to open it, when user click on it. but if user had installed acrobotreader in his/her pc, my link open the file directly. but i dont want to act so. i want file to be downloaded. thanks rastgar
You can't force anything with a static HTML page, I don't believe. You'd have to zip the file.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
You can't force anything with a static HTML page, I don't believe. You'd have to zip the file.
Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
-
You can't go too far with JavaScript either. You can open in a new window.
Vasudevan Deepak Kumar Personal Homepage Tech Gossips
-
i have a static html page. i have a link in it to download a pdf file. i want to force download the file, not to open it, when user click on it. but if user had installed acrobotreader in his/her pc, my link open the file directly. but i dont want to act so. i want file to be downloaded. thanks rastgar
-
i have a static html page. i have a link in it to download a pdf file. i want to force download the file, not to open it, when user click on it. but if user had installed acrobotreader in his/her pc, my link open the file directly. but i dont want to act so. i want file to be downloaded. thanks rastgar
just call a javascript function with an open command to the link in onclick event. Example:
open("download/file.pdf","_blank");
this will ask you if you want to open or save.Contact me! Please feel free to visit my site