Ask Experts Questions for FREE Help !
Ask
    josephsweet's Avatar
    josephsweet Posts: 1, Reputation: 1
    New Member
     
    #1

    Jan 29, 2005, 02:23 PM
    Getting insane - jakarta commons fileupload
    Hello,

    I was reading an article about the org.apache.commons.fileupload component
    here:
    http://www.onjava.com/pub/a/onjava/2...ns.html?page=3
    and also here:
    http://jakarta.apache.org/commons/fileupload/using.html

    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:
    http://cvs.gridsphere.org/cgi-bin/vi...ad-1.0-dev.jar

    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:
    http://jakarta.apache.org/commons/fi...index-all.html

    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 your 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,
    Joseph :confused:
    sandapola's Avatar
    sandapola Posts: 1, Reputation: 1
    New Member
     
    #2

    Apr 19, 2007, 09:44 AM
    Keep the following jars in your lib folder of eclipse and ensure that these jars are checked in your Project->Properties->Java Build Path.
    Commons-fileupload-1.2.jar
    Commons-io-1.3.1.jar
    Also see that you add the following to your fileuploaddemo.jsp import statement.
    org.apache.commons.io.*,org.apache.commons.io.inpu t.*,org.apache.commons.io.output.*
    I suggest you first try the example posted by Vikram Goyal and then try the jakarta tutorial.See that in your compiler settings you are not throwing error if your code is using deprecated API but a warning is displayed in the page.
    Rebuild the project and then run the application.
    I don't know why a space is being introduced at inpu t.Just verify once you paste the same.
    All the best.:)

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Please help with this movie I'm going insane [ 1 Answers ]

All I remember is it was set in space and was based around humans and aliens dueling in an arena. I think it was 80s possibly early 90s and I'm sure one of the monsters looked a little like a giant cricket, and its weakness was its stomach, and another alien had cybernetic attachements please...

I may sound insane but... [ 7 Answers ]

Hi, you may think I'm crazy but please help me! I'm still in middle school but I want to get pregnant, but I don't want to get in trouble from my mother, but I really want a baby! If you got to know but never saw my face you might think I was 21 or over! So I know that I'm responsible enough! How...


View more questions Search