faqts : Computers : Programming : Languages : JavaScript : Document

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

41 of 165 people (25%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

Is it possible to force the browser to download .txt (or any other) instead of viewing it?

Aug 25th, 2000 09:34
Martin Honnen, mul mad,


Not with client side JavaScript. You need to use server side methods to 
send the file with a context type which the browser can't display but 
offers for download. 
  application/x-octet-stream
is I think often used for that. Note that there are reports that IE 
tends to ignore the content types and displays nevertheless.