Issue Details (XML | Word | Printable)

Key: FILEUPLOAD-114
Type: Wish Wish
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Henri Yandell
Reporter: Olle Sundblad
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons FileUpload

Documentation: dependency on commons-io and other things

Created: 03/Aug/06 12:16 PM   Updated: 14/Sep/06 08:12 AM
Return to search
Component/s: None
Affects Version/s: 1.1.1
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 14/Sep/06 08:12 AM


 Description  « Hide
Somewhere in the documentation (User guide and/or FAQ) I think there should be at least one sentence specifying that FileUpload requires the Apache commons-io package.

From someone who spent a good 4h of frustration to learn that.

Also in the User guide:

// Check that we have a file upload request
boolean isMultipart = ServletFileUpload.isMultipartContent(request);

isMultipartContent is Deprecated and I couldn't find a replacement for it in 1.1.1. And in the following:

// Create a factory for disk-based file items
FileItemFactory factory = new DiskFileItemFactory();

// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload(factory);

// Parse the request
List /* FileItem */ items = upload.parseRequest(request);

the factory is not working in this state you need to

factory.setRepository(someDir);

or use the other constructor.

otherwise thanks for an other great product (now that I can use it)
/Olle
PS Why are you not using generics?



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Henri Yandell added a comment - 04/Aug/06 05:55 PM
There are places on the site that mention the commons-io bit - but putting the dependency at the top of the user guide sounds like a very good idea.

The reason for not using generics is to support pre 5.0 users; there are still a lot around. About the only thing you can really be sure about nowadays is that 1.1 can be ignored.

Thanks for the report; will work on getting them fixed.


Henri Yandell added a comment - 04/Aug/06 05:59 PM
Olle, do you have the error message you were getting when IO was not present? If so, then I could also make a FAQ entry.

Henri Yandell added a comment - 04/Aug/06 06:07 PM
On the need for a directory to be set - looks like the intention was for the code to use java.io.tmpdir as a default, but the code doesn't match that. So need to find out if the code or the docs should change.

Jochen Wiedmann added a comment - 06/Aug/06 04:02 AM
> Also in the User guide:
>
> // Check that we have a file upload request
> boolean isMultipart = ServletFileUpload.isMultipartContent(request);
>
> isMultipartContent is Deprecated and I couldn't find a replacement for it in 1.1.1.

I have changed the docs in that sense.


Amichai Rothman added a comment - 01/Sep/06 10:01 PM
Running under Tomcat 5.5 I got the error:

java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream

this may be a bit implementation dependent... I guess any NoClassDefFoundError for org/apache/commons/io classes would mean the same thing - perhaps this can be explained in the FAQ/userguide just in case.


Henri Yandell added a comment - 14/Sep/06 05:25 AM
FAQ entry added.

Just need to deploy the site now so this issue can be resolved.


Henri Yandell added a comment - 14/Sep/06 05:32 AM
Site should be deployed in 2 hours.

Henri Yandell added a comment - 14/Sep/06 08:12 AM
Site deployed.