views:

26

answers:

2

can I set content-disposition = attachment via javascript.

Basically, I would like to force a "SaveAs" operation after a page has loaded via Javascript, using Firefox.

How can I do this ?

A: 

after the page is loadet, the header is already interpreted, so it wouldn't make any sense to change it then.

why can't you set the header on server-side?

oezi
I am writing a small testing tool which is basically a js script I write.I want to keep a log. And I needed a way to write to a system file. I was thinking if, I could keep writing to an iframe and then inject a content-disposition. I guess it was far fetched anyway.
Prakash Raman
+3  A: 

Content-Disposition is a response header, ie. the server must return it. You can't achieve this with client-side javascript.

nnevala
Right that is what I thought.
Prakash Raman