Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploaded files are incomplete

 
Lance Hill
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to upload a pdf to the server's file system. I seem to be able to upload the file, but it is incomplete.

Once it is on the server, I would like to use an action to find the pdf and display it to the browser. This also seems to break the file. If I put a good pdf in place on the server, when I stream it to the browser, I get an error that the file is damaged.

When I look at the file after it is uploaded, I can see that it is not the complete file, so I suspect something is going wrong when I am reading the file in.

Any advice on how to ensure I get the entire (and unbroken) file would be appreciated. Any examples of better or easier ways to do this would be even more appreciated.

Code follows.

File Upload Action:

View File Action
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic