This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
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.