permaculture playing cards
The moose likes Other Open Source Projects and the fly likes problem with org.apache.commons.fileupload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "problem with org.apache.commons.fileupload" Watch "problem with org.apache.commons.fileupload" New topic

problem with org.apache.commons.fileupload

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327

I was reading an article about the org.apache.commons.fileupload component
and also here:

and it just seems not to work for me. I would appreciate your help.

I am using the jar file commons-fileupload-1.0-dev.jar that was downloaded from here:

I work on eclipse and it does not compile.

The first problem is that it cannot find the method isMultipartContent in the following code (taken from that article example):

// first check if the upload request coming in is a multipart request
boolean isMultipart = FileUpload.isMultipartContent(request);

I am looking in the eclipse into that jar and it seems like that method is really not in the FileUpload class.

What is wrong?

It is there in the source code, so why not in the class found in the far file.

By the way, when I looked at the jakarta reference here:

and they say this method is deprecated:

"isMultipartContent(HttpServletRequest) - Static method in class org.apache.commons.fileupload.FileUploadBase
Deprecated. Use the method on ServletFileUpload instead."

So why do they use it in their code.

Also, they say "Use the method on ServletFileUpload instead".

That class is suppposed to be in the package:
import org.apache.commons.fileupload.servlet.*;

But there is not such a subdirectory in the zip source code I downloaded from the jakarta project.

Could you please help me solve these problems.

Thank you,

We must know, we will know. -- David Hilbert
Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
I'm a little suspicious about the source of your jar. The URL has "Attic" in the name which means it's from a dead cvs head revision.

Why don't you try again from jakarta page.
I agree. Here's the link:
subject: problem with org.apache.commons.fileupload
jQuery in Action, 3rd edition