aspose file tools*
The moose likes JSP and the fly likes Garbage value while downloading .doc through JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Garbage value while downloading .doc through JSP" Watch "Garbage value while downloading .doc through JSP" New topic
Author

Garbage value while downloading .doc through JSP

akshay khopkar
Greenhorn

Joined: Jul 30, 2012
Posts: 1
Hi,

I am trying to upload and download documents in DB through JSP. For this purpose I use a table with BLOB data type and store byte array in it. Problem is, code is working fine for pdf, txt and jpeg. But in the case of .doc a document with lots of garbage character is getting generated.

To pin point the problem, I removed the part, which was used to store and retrieve byte array from DB. Now I am trying to write byte array in output stream, in the page used to upload file itself. But still i am getting a .doc with garbage value.

My current code looks like:



Please suggest to debug..!!

Thanks :)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61653
    
  67

akshay khopkar wrote:
I am trying to upload and download documents in DB through JSP.

That is your first mistake. JSP is unsuitable for this task. You should be using a servlet.

Please read this article ti understand why JSP is poor choice for this task.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Garbage value while downloading .doc through JSP