This week's book giveaway is in the Raspberry Pi forum.
We're giving away four copies of Getting started with Java on the Raspberry Pi and have Frank DelPorte on-line!
See this thread for details.
Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

A problem with servlet file transfer

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 81
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nobody else? I need solution. Help me, please!
 
Sheriff
Posts: 67732
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Always look on the bright side of life. At least this ad is really tiny:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic