• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A problem with servlet file transfer

 
Pham Minh An
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a new Java programer. I have a example for sent file.(word file. Using ms-word 2003). The file is downloaded successful but it can't open. The ms-word messages are: "Word experienced an error trying to open the file. Try these suggestions......". This's my code:


The word file template's content: text and image(jpg). The file size: 116KB. i am looking forward to hearing from you.
Thanks...
 
olivier dutranoit
Ranch Hand
Posts: 81
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The file is downloaded successful but it can't open"

are you sure the file is correct? I think your client receives an empty file...or with junk in it...

save the file on the client and check its content...if its not good, there must be a problem with your original file, or your servlet's code!

 
Pham Minh An
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for reply, olivier dutranoit. If the file's content are only text, it's ok. But, If i insert images or new lines, the error message is display.
 
Pham Minh An
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nobody else? I need solution. Help me, please!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A post that goes unanswered usually means that you have not provided enough information on the problem. So rather than posting useless bumps like that last one, provide more information that can help solve the problem.

For example, what have you done too ensure that the file is correctly formatted? How is the file being generated in the first place? And so on.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic