Originally posted by Ulf Dittmer: The download only has a single jar files that contains classes. The other two files contain the source and the javadocs, as their names imply.
I downloaded 'commons-fileupload-1.2-src.zip' file and it doesn't contain any JAR file.
Is that the same one you took? [ February 23, 2007: Message edited by: ankur rathi ]
1. isMultipart is always true because I have added 'enctype' attribute in the form, before it was always false. I suppose it should be decided on the basis of data not on the basis of this attribute.
2. items list has no item always. But I am supplying data in both the input fields.
Please help. Thanks.
g forte
Greenhorn
Joined: Aug 28, 2003
Posts: 25
posted
0
I think you need an id for your form fields.
Also, did you grab the 2 required jars(fileupload.jar and the io jar)? HTH! [ February 23, 2007: Message edited by: g forte ]
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
posted
0
Originally posted by g forte: I think you need an id for your form fields.
It worked. Thanks G.
Is following the right way to implement upload functionality:
I am able to get the file name and file content at server side. Now with some string operations I get the extension then based on the extension I choose the image (icon of doc, ppt, txt, pdf etc) to display to user and I set href to the same kind of file that has the content which I just got, and that is called when clicked on that image.
Hope that is clear.
Is there any better way?
Thanks.
g forte
Greenhorn
Joined: Aug 28, 2003
Posts: 25
posted
0
Sounds good, unless you need to offer this file(the one just uploaded) to other users to download. In that case, I would change the mime type to response.setContentType("application/x-download"); Which would force the download dialog as opposed to opening it up in the browser. HTH