| Author |
display html and pop up save dialog box
|
Bhumika Thakkar
Ranch Hand
Joined: Apr 18, 2005
Posts: 79
|
|
Hello Everyone, I have a html page that displays a table. I'd like to dispay the table to the client and pop up a dialog box to save that same html, both in one request. Is that possible? Thanks in advance, Bhumika.
|
SCBCD (Preparing) <br />SCWCD, 82%<br />SCJP, 90%
|
 |
Rizwan Mohammad
Ranch Hand
Joined: Sep 02, 2005
Posts: 445
|
|
Hi, I think this is not the exact forum to discuss your solution. This is completely for scwcd preparation. Any way, why dont u submit another form/iframe(from same page) onload of the html page, redirecting to the same page and you can set appropriate headers second time to display the popup?
|
Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
|
 |
Bhumika Thakkar
Ranch Hand
Joined: Apr 18, 2005
Posts: 79
|
|
Thanks for the response. i don't want to make another trip to the server...
|
 |
Rizwan Mohammad
Ranch Hand
Joined: Sep 02, 2005
Posts: 445
|
|
I dont think that you can make this in one round trip. 'content disposition' header can be either be inline or attachment at a time. We cannot have both. Though it is possible to add two values for same header(not sure for what are all header we can add!!), using response in the following way. response.setHeader("Content-Disposition", "inline"); response.addHeader("Content-Disposition", "attachment;filename=test.txt"); I guess it is up to the browser whether it can understand/interpret the document as both inline and attachment same time. Atleast my browser(IE 6.0) doesnt understand both at same time. I am not sure which spec defines about interpreting multiple values of header. HTH.
|
 |
 |
|
|
subject: display html and pop up save dialog box
|
|
|