Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

download bytes

 
Fernando Dominguez
Ranch Hand
Posts: 104
Debian Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello;

I would like that the browser (firefox) whre able download the zip file from my servlet ( byte array).

I tried the following

... but it doesn't works.

Thanks.
 
Ankit Garg
Sheriff
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just saying that It Doesnt Work Is Useless. Tell us more details about what is happening...
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Use ServletOutputStream when you writes write byte data and close the stream after finishing.
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fernando Dominguez wrote:I would like that the browser (firefox) whre able download the zip file from my servlet ( byte array).
I tried the following


Hi Fernando,

When you are writing raw bytes you should use ServletOutputStream instead of PrintWriter and write the bytes to the stream (that's just pure Java).

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic