File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Uploaded files are incomplete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Uploaded files are incomplete" Watch "Uploaded files are incomplete" New topic

Uploaded files are incomplete

Lance Hill

Joined: Oct 13, 2004
Posts: 14
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
I agree. Here's the link:
subject: Uploaded files are incomplete