What's the problem of  uploading file in this code

hi,
i have written following code for uploading a an image file. But when i run this pogram in Eclipse3.1.2 then it shows following Error:
I have written following file for selecting a file
<body>
<form action="display.jsp" method="POST" enctype="multipart/form-data">
<input type="file" name="File1">
<input type="submit" name = "button" >
</form>
</body>
display.jsp file contain the following code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<%@page import="org.apache.commons.fileupload.*" %>
<%@page import="java.io.*" %>
<%@page import="java.util.*" %>
</head>
<body>
File uploaded
<%
     boolean isMulti = FileUpload.isMultipartContent(request);
DiskFileUpload upload=new DiskFileUpload();
     List items=upload.parseRequest(request);
     Iterator iter=items.iterator();
     while(iter.hasNext()){
          FileItem item=(FileItem)iter.next();
          if(item.isFormField()){
               String name=item.getFieldName();
               String value=item.getString();
               %>
               <%=name%>
               <%=value %>
          <%}else {
          InputStream stream=item.getInputStream();
          OutputStream os=new FileOutputStream("d:/image.jpg");
          int bytesRead = 0;
          byte[] buffer = new byte[8192];
          while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
          os.write(buffer, 0, bytesRead);
          os.close();
          stream.close();
          item.delete();
%>
</body>
</html>Error is:
org.apache.jasper.JasperException: Exception in JSP: /display.jsp:19
16:
17:      boolean isMulti = FileUpload.isMultipartContent(request);
18: DiskFileUpload upload=new DiskFileUpload();
19:      List items=upload.parseRequest(request);
20:      Iterator iter=items.iterator();
21:
22:      while(iter.hasNext()){
Stacktrace:
     org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.ServletException: org/apache/commons/io/output/DeferredFileOutputStream
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
     org.apache.jsp.display_jsp._jspService(display_jsp.java:103)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
     org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:102)
     org.apache.commons.fileupload.FileUploadBase.createItem(FileUploadBase.java:500)
     org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)
     org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
     org.apache.jsp.display_jsp._jspService(display_jsp.java:62)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Is there anybody can help me? Why this code is not working. I have used Tomcat5.5 for the server. Please help me
With regards
Bina

You should have commons-fileupload.jar in common/lib or in ur applications lib directory( I mean WEB-INF/lib). Dont forget to set the build path to commons-fileupload.jar in Eclipse.
Go to
project > properties > Java Build Path > libraries > click on Add External Jars button > choose ur commons-fileupload.jar file > click on OK

Similar Messages

  • HT200109 There is no menu :Movie Purchased. What is the problem? I can view this menu before.

    I boght some movies directly from aple TV, but when I want to watch them again I can not find menu "purchased"
    Any body can help?
    Thank you.

    Welcome to the Apple community.
    A number of people have reported similar issues recently, most appear to have found a discrepancy of some kind in their account settings and making changes to these settings has resolved the matter.
    Check your account details are correct, check that you are using the correct details for Location, Region and Time Zone. You may want to change these settings and then change them back to see if that helps.
    Also check your payment details, make sure your details are exactly how they appear on your credit card statement, you might also try changing some of those details, saving them and changing them back again.
    You might also try logging out of and then back into your iTunes account and restarting your router.
    Rentals should appear under their own heading in the ‘Movies’ feature, you might also check at Settings > iTunes Store > Check For Rentals.

  • Problem of upload file into the fieldpoint

    hi,all
    I have build the program for fieldpoint.Then,i want to upload it to the fieldpoint 2000.But it dont allow me to do so,said that it is not authorized to do so. But i cannt upload any file or build any new file. However,i can upload a small VI which is around 10K in size but not for 40K in size.What is the problem with it. Can anyone give me hand ? Thanks

    The following is a very interesting knowledgebase document for your problem.
    http://digital.ni.com/public.nsf/websearch/44F57933B2E97BF086256B7400728A7C?OpenDocument
    SergesL

  • What is the problem with IPhoto ´11 when I am uploading a photobook to apple store, there is always an error. Anyone ???

    What is the problem with IPhoto ´11 when I am uploading a photobook to apple store, there is always an error. Anyone ???
    evrything is right wite my appleID.

    First try to create a pdf file of the book as described in this Apple document: iPhoto '11: Preview a book, card, or calendar before you order or print it.
    If you are unsuccessful in creating the pdf file then boot into  Mac OS X: Starting up in Safe Mode and try again.  If that works you can continue and order the book while in Safe Mode. 
    Be sure to keep the pdf file of the book to compare with the printed copy when it arrives.
    OT

  • Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Hi Memalyn
    Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
    My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
    If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
    Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
    Let us know what you find out, and if you manage to get your space back.
    Matt

  • Cannot install itunes 11.1.3 to my windows vista home premium 32-bit.  After it finishes the download that it verifies the file I get a message saying "this file cannot be downloaded". What could the problem be??? I uninstalled my itunes and tried again

    Cannot install itunes 11.1.3 to my windows vista home premium 32-bit.  After it finishes the download that it verifies the file I get a message saying "this file cannot be downloaded". What could the problem be??? I uninstalled my itunes and tried again and keep getting the same message.  Please help !

    See Troubleshooting issues with iTunes for Windows updates.
    For downloading issues see the further information area and use a different browser and/or the direct links.
    tt2

  • Aperture wants 825 MB more diskspace, but my HD has 630 GB free space. A perture doesn't let me import my latest raw files. What's the problem?

    Hi, I have Aperture 3.2.2 installed on a iMac with OS 10.6.8
    While I plug in my Nikon to import my raw files from today, Aperture tells that I need 825 MB more space on the disk.
    But actually I have more than 600 GB free space on my HD. So what is the problem? What should I do?
    Any ideas?
    Cheers
    Andreas

    Not sure.
    Try these, though:
    . Empty Aperture Trash
    . Close Aperture
    . Empty system trash
    . Reboot
    . Try the import again.
    What does Finder tell you about the free space on the drive volume in question after you've emptied the system trash?
    Are all of your Image's Masters managed?
    Are you sure you have Aperture set to import to the drive you want?

  • Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created". What's the problem?

    Set Adobe Acrobat XI Pro. When I want to save the file in WORD, EXCEL or esporta file into ... immediately throws an error "save as failed to process this document no file was created".
    What's the problem?
    Any help in finding a solution is greatly appreciated.
    Thank you,

    Installed AcrobatXI PRO 11.0.09  on seven computers and laptops. Two of them gives an error when you try to save a document in WORD, EXCEL, Power Point, or when exporting to... error: Save failed to process this document. No File was created.
    But all good saves in the format of TXT and jpg.
    I have uninstalled and restored and re-installed and updated and registry cleaned and removed using the special utility Cleaner Tool for Acrobat, but nothing helps.
    On one notebook with Windows 8.1 and Microsoft office 2013, on another laptop with Windows 7 and Microsoft office 2010, the same problem, although there are computers with Windows 7 and Microsoft office 2010 and everything works.
    Tell me where to find the problem and how to solve it.
    Thank you.

  • A file want to save with this name "xstat_save" when i enter to some site .what is the problem?

    hi
    when i enter to some site like "http://www.mehrnews.com/en/" , a massage appear that a file with this name "xstat_save" want to save in hard disk.type of file is "aspx"
    what is the problem?
    plz help me
    thanks for your attention

    You usually see such a dialog to save a file if you have ad-blocking or security software that remove the GET data appended to a link to specify which file to load from the server.

  • MacBook Air will not reboot. A file folder with a question mark in the center of it appears. What is the problem?

    MacBook Air will not power on or reboot. A file folder with a question mark in the center of it appears. What is the problem?

    Go step by step and test.
    http://support.apple.com/kb/ts1440
    Startup Manager to select Startup disk.
    http://support.apple.com/kb/HT1310
    Repair Disk
    Steps 2 through 8
    http://support.apple.com/kb/PH5836
    Reset PRAM.
    http://support.apple.com/kb/PH4405
    Reinstall OS X
    If this does not help, contact Apple.
    Best.

  • I purchased Lightroom 5, loaded it on my Mac, and updated to version 5.6. I then tried importing photos from my Sony DSC-RX100iii. Unfortunately it only imports JPEG files but no RAW files. What is the problem and how do I fix it?

    I purchased Lightroom 5, loaded it on my Mac, and updated to version 5.6. I then tried importing photos from my Sony DSC-RX100iii. Unfortunately it only imports JPEG files but no RAW files. What is the problem and how do I fix it?

    Than LR should have brought in the RAW files as well. ACR is the RAW
    processing engine used by LR under the covers so anything not supported by
    ACR would not be supported by Lightroom.
    Are you shooting RAW plus JPEG? By default, Lightroom will stack then
    unless you tell it not to. Check to see if there is a small badge on the
    preview that looks like two sheets of paper with a number. That is how
    Lightroom indicates a stack. You can unstack them by clicking on the badge.
    There is also a menu item to stack/unstack photos. Otherwise, I would have
    to research but not sure why Lightroom would ignore the RAW photos but
    still import the JPEGS.

  • I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the

    I installed the InDesign CC Testversion and now i try to open INDD-Files from earlier Version. Always i get the error "This file is made by an earlier Version...." but it´s CC that is the latest Version. What is the problem ? Should i have to convert the files ?

    Adobe has been using confusing version names for at least five years.
    There are now two versions labeled CC, version 9 and version 10 (also known as CC 2014). Version 10 is the latest, and if you attempt to open a version 10 file in Version 9 that is not fully patched you will get an error message telling you that the file cannot be opened. The latest patch for version 9 should use a cloud-based service at Adobe to convert version 10 files to IDML and allow you to open that.
    I suspect you may be using an older operating system. Version 10 requires that your system runs at least OS X 10.7 or Windows 7 SP1 and if you are not it will not even be offered to you.

  • I've been attaching pdf's to emails forever.  All of the sudden my pdf files won't attach to any email.  I have tried from home, work, different providers, etc.  Nothing is working.  What could the problem be?

    I have been attaching pdf files to emails forever.  All of the sudden my pdf files won't attach to an email.  It just sits there and spins like it's trying to attach but quits half way through.  What could the problem be?

    Please try repairing Reader installation on your machine. Do you get any error message while attaching the pdf file?
    Regards,
    Deepak

  • HT201317 My 4s and my ipad3 are both connected to wifi and icloud is turned on. The photos on the 4s do not upload to the ipad3. I have turned icloud off and on on both devices. It also does not upload to my PC. What is the problem?

    My 4s and my ipad3 are both connected to wifi and icloud is turned on. The photos on the 4s do not upload to the ipad3. I have turned icloud off and on on both devices. It also does not upload to my PC. What is the problem?

    Welcome to the Apple Community.
    Photostream only syncs photos over Wi-Fi, make sure you are connected to Wi-Fi to begin with.
    Photostream only syncs when the camera app is closed, ensure it is closed.
    Photostream only syncs when the battery is above 20%, try recharging the device
    Try disabling photo stream on your device (settings > iCloud), restarting your device and then re-enabling photo stream.
    If this doesn't help you may need to reset photo stream. You can do this at icloud.com by clicking on your name in the top right corner and then the advanced settings in the pop-up dialogue box that appears.
    Note: disabling photostream and re-enabling it will result in any photos that are currently in the photostream album on your device, that are older than 30 days old, not being added back.

  • HT1848 when i go to the file and get the devices, i am unable to sync or transfer purchases or anything in that column. It appears white and not the usual black writing. What is the problem ?

    I am unable to sync and transfer purchased items to my computer as i am unable to open the the transfer tab (it is white instead of the usaul black writing). What is the problem ? (The itunes is authorised for my computer.)

    If this is a new computer you need to authorise it.  In itunes click on STORE and hten authorise this computer.
    After this if you cannot find your phone read these articles
    Phone not recognised in itunes
    device not recognised by iTunes on PC  or  device not recognised by iTunes on Mac

Maybe you are looking for

  • Trying to update itunes for ipod touch.  Error message: error writing to file c:\Program /files (x86)\ itunes\itunes.resources\cs.lproj\djintro\objects.xib

    After 4 hours I am getting ready to throw my Acer out the window.  I have tried everything I can possible think of.  Initially couldn't sync ,y ipod but after following advice managed this.  Removed all itunes components on system but the above messa

  • NF750-G55

    Hello, My Specs: Summary       Operating System          MS Windows 7 Ultimate 64-bit       CPU          AMD Phenom II X4 955   34 °C          Deneb 45nm Technology       RAM          4.0GB Single-Channel DDR3 @ 733MHz (9-9-9-20)       Motherboard   

  • Sales with third-party manufacturer

    Hi gurus, I need your help with the following sales scenario: My company produces product A. Product B can be manufactured applying minor changes in product A. However, my company doesn't have the machinery to do these changes. They need to be done b

  • Creation Of Asset Class

    While creating a asset class error is coming "Screen Layout Control 200" is not maintained. Where as i maintained the account determination as well as the screen layout Pls help.

  • Sysdate gives Invalid column name

    Using Oracle/Tomcat, I'm invoking the following query through JSP: SELECT id from my_table where create_date >= (sysdate-10) where create_date is a field in my_table. When I run it through JSP, it gives me Invalid column name error, but when I copy t