*
The moose likes Servlets and the fly likes File get currupt if downloaded by response.getOutputStream(); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "File get currupt if downloaded by response.getOutputStream();" Watch "File get currupt if downloaded by response.getOutputStream();" New topic
Author

File get currupt if downloaded by response.getOutputStream();

Pritish Shirsath
Greenhorn

Joined: Apr 06, 2010
Posts: 1

Hi,
I am trying to download file (of any type pdf/rar/any etc...) using following code,
but SOME TIME downloaded file is currupted.



but when I use


insted of


It works, & download file by name "MyFile" in bin of tomcat folder.
but not work with response object.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

Please UseCodeTags (⇐ click link)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3011
    
  34

"Pritish Ss", please check your private messages regarding an important administrative matter.


Founder of ExamLab and Systemup
See how I can help you to become an awesome programmer
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: File get currupt if downloaded by response.getOutputStream();
 
Similar Threads
Title as PDF file name
Excel file - download
Transfer multiple files from Server to Client using Sockets
getOutputStream() has already been called for this response
Sending a file over socket