• Post Reply Bookmark Topic Watch Topic
  • New Topic

sendign PDF to screen while downloading

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

I have a servlet which writes a PDF to the ServletOutputStream so that it gets sent to the browser or plugin.

Now I need the servlet to download 12 png files (that exist in memory) in addition to sending the aforementioned PDF to the browser.

IS this possible in one servlet?

Thanks

Eric
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Short answer, no.

It is certainly possible to stream multi part encoded data from a servlet.
The problem would be the client.
If browsers support it at all, I doubt it would be consistent across makes and versions.

One common approach is to zip up all the files and stream a single zip arcive to the client.
 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I'm going to try zipping them all up.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!