Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reading ms word doc file  RSS feed

 
sandip raut
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
how can i read clients word file and display on browser as soon as uploading. my code working with txt file but doc file showing error
regarding new line and fonts.
PLEASE Help me.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also be aware that the browser may be configured to not show the file, but instead pop up a little dialog asking the user what to do with the file.
 
Minh Tran
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After file uploaded, you can use this Lib from Apache to manipulate Microsoft Word/Excel files
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!