File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display html and pop up save dialog box

 
Bhumika Thakkar
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bhumika Thakkar
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response.
i don't want to make another trip to the server...
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic