wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes file uploading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "file uploading" Watch "file uploading" New topic
Author

file uploading

rakesh gaddam
Greenhorn

Joined: Jan 06, 2005
Posts: 15
Hello,

I am trying to upload a file from a jsp page.I have used commons-fileupload package.

If I mention the enctype as multipart/form-data in my jsp page ,I am getting an IllegalArgumentException: argument type mismatch error.

If I remove the enctype as multipart/form-data from my jsp page, the method
isMultipartContent(request) is returning false with the error message:

the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded.

Can anyone help me with this.

Thanks
Rakesh.
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Are you trying to GET rather than POST as the method for the form?
rakesh gaddam
Greenhorn

Joined: Jan 06, 2005
Posts: 15
I am using the method POST for the form.


Any idea as to what mistake I am making.

Thanks
Rakesh.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Here's some HTML code that I use for uploading files:And I am uploading to Commons Fileupload. But now that you mention it, I just installed version 1.1 of that product and it started giving me deprecation warnings about the isMultipartContent method. I didn't have any problems using the so-called deprecated method, but to make the warnings go away I eventually figured out to use this code:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file uploading
 
Similar Threads
File Upload Issues
take in file from client machine
Problem in running simple JSP
File Upload
problem with enctype="multipart/form-data"