You are uploading a file from the client and immediately sending it back to the client? That sounds a bit strange to me.
Anyway, if your process works with plain text but not with binary formats like MS
Word, then you are probably using Reader and Writer to handle the file. Those don't work with anything except plain text. Switch to using InputStream and OutputStream.