File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 60782
    
  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: 3019
    
  35

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


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
 
 
subject: File get currupt if downloaded by response.getOutputStream();
 
Similar Threads
Sending a file over socket
getOutputStream() has already been called for this response
Title as PDF file name
Excel file - download
Transfer multiple files from Server to Client using Sockets