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.