PDA

View Full Version : how to Pop up file download window


jack2000
02-18-2003, 05:04 AM
HI,

I got a question: I want to put a hyperlink in the web page. The hyperlink pointed to a Text File. When I clicked the hyperlink, I want to pop up file download window instead of opening a new window to display file content. Can I do it ? I tried to change file extension to Zip. It works. If I want to keep ".txt" extension, how to do it ?

Tx.

meow
02-18-2003, 05:22 AM
I don't think that trick works in all browsers. Basically you can't force a download. Why not just zip the file?

Read this:
http://www.htmlhelp.com/faq/html/media.html#force-download

kwhubby
02-18-2003, 05:49 AM
yes you can do it, but you need to change the mime extension properties on your server wich I don't really expect you have access to :p
you can tell them to right click and click save target instead of just clicking the link :)

arnyinc
02-18-2003, 01:43 PM
This can be done in PHP, and I believe ASP as well. When a user clicks the link it pops up the "Save as..." prompt instead of opening the file if they have it associated.

Do you have access to either of these server side languages?

requestcode
02-18-2003, 01:51 PM
I would be interested in seeing some examples in PHP or if you could point me to a site where there is some sample code. I would like to do the same thing, but have not found any examples that work with text files.