• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

display html and pop up save dialog box

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic