Help:simple file upload example not working

Request input on what's wrong with this -
Using JDeveloper 10G.
1) I created a simple jsp file upload file using the OJSP
File Access Tag library options. With empty JSP file,I
dropped in the httpUploadForm and the httpUpload tags.
Now when I run this I get the following error stack on
the web page.
javax.servlet.jsp.JspTagException: Posted content type isnt multipart/form-data at oracle.jsp.webutil.fileaccess.tagext.HttpUploadTag.doStartTag(HttpUploadTag.java:130)at test4.jspService(test4.jsp:10)[test4.jsp]
2)Now if I use a simple JSP without the tag library - the
page fails to display. Found that commenting out the
line "upbean.upload()" lets the page run and atleast
show me the upload form. What's wrong with this
standard example from the OC4J documentation -
<%@ page import =
"javax.servlet.http.*,
java.io.*,
java.util.*,
oracle.jsp.webutil.fileaccess.*;" language="java" session="true" contentType="text/html;charset=windows-1252"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Upload</title>
</head>
<body>
<% String userdir = "mydir"; %>
<form action="pUpload.jsp" ENCTYPE="multipart/form-data" method=POST>
<br>
File to upload: <INPUT TYPE="FILE" NAME="File" SIZE="50" MAXLENGTH="120" >
<br>
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Send">
</form>
<jsp:useBean id="upbean" class="oracle.jsp.webutil.fileaccess.HttpUploadBean" >
<jsp:setProperty name="upbean" property="destination" value="<%= userdir %>" />
</jsp:useBean>
<% upbean.setBaseDir(application, request);
//upbean.upload(request);
%>
</body>
</html>

It's not clear from your post, but are you aware that the
documentation is really showing multiple files?
The doc examples are based on the ones you can try out by downloading the ojspdemos.ear file.
They use discrete steps. For example, the fileUploadIndex.html contains the following
This will call the form and set the action in the form to call the tag upload jsp file. The form will do the multi-part post and the tag upload file does display the text after the <upload:httpUpload> tag. I just re-ran the example to be sure.
The same basic mechanism applies to the upload bean. That is it is called via:
This is the only way that these can work because the upload code (beans & tags) both require a multi-part post. I hope this helps

Similar Messages

  • Export to Excel and File Upload is not working on ipad/IPhone

    Hi
    We have a site in ASP.Net 2008 which is running on browsers and devices. There is an option to export to excel and file uploadd, It is working in the browsers but not working in Devices like IPad and Iphone. we are creating xml file when export to excel. We have tried it on IPad1,IPad3 and iphone3.
    can you please elaborate the causes of these issues? Pleas support to fix the issues.
    Regards,
    Manoj

    How does your PL/SQL for the saving of uploaded files looks like? Where does this error happen? Does your process have an error message?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • File upload is not working

    Hi
    The file upload (any kind static/image etc) is not working.
    It is giving error "No Data found". This happens only on certain PCs, on other PCs, it works fine.
    Have any one experience such issue ? I am not sure how to trouble shoot this, as there are no errors in Apache logs and no record created in wwv_flow_file_objects$.
    TIA
    DineshS

    How does your PL/SQL for the saving of uploaded files looks like? Where does this error happen? Does your process have an error message?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Jakarta Commons -- File Upload does not work with Application Server

    Hi ALl,
    I tried Jakarta Commons file upload. In the netbeans, I copied the common jar files "commons-io-1.2.jar" and "commons-fileupload-1.1.1.jar" in the
    netbeans-5.5\enterprise3\apache-tomcat-5.5.17\common\lib and set the class paths. It is working correctly when I compile and run from the netbeans. However, when I deployed in Sun Application Server PE 9.0, I am receiving the following errors. In Sun application I copied the above jars files to "C:\Sun\AppServer\jdk\jre\lib\ext"..
    I have read in several postings that it does not work this way but could find any solution. Any idea will be greatly appreciated.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:930)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:863)
         org.apache.jsp.fileUpload_jsp._jspService(fileUpload_jsp.java:109)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:409)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:317)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    root cause
    java.lang.NoClassDefFoundError: javax/servlet/ServletInputStream
         org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:116)
         org.apache.jsp.fileUpload_jsp._jspService(fileUpload_jsp.java:76)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:409)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:317)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    note The full stack trace of the root cause is available in the Sun Java System Application Server Platform Edition 9.0 logs.
    Sun Java System Application Server Platform Edition 9.0
    Thank you,
    --Sam                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi All,
    I solved this few minutes after I posted this question. Thought I should share with everybody, just in case some one else need it.
    I copied these three files in the folder C:\Sun\AppServer\jdk\jre\lib\ext
    1. servelet-api.jar
    2. commons-io-1.2.jar
    3. commons-fileupload-1.1.1.jar
    No need to set any class path.
    Thanks

  • File Upload UI not Working

    Hi all,
    I am using File Upload UI for one my application, for that i created a context attribute of type
    com.sap.ide.webdynpro.uielementdefinitions.Resource
    , i placed one button which has the action whether any file was selected or not.
    public void onActionuploadSelectedFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        if(wdContext.currentContextElement().getCaResource()!=null)
             wdComponentAPI.getMessageManager().reportSuccess("File Selected");
        else
              wdComponentAPI.getMessageManager().reportSuccess("File not Selected");
    i am getting the message 
    File not Selected
    when no file was seleted. But when i select a file i am not getting any message.
    Kindly help me and let me know where is the actual problem....
    Currently I am using NWDS 7.0.11
    Thanks & Regards,
    Chandran S

    Hi,
    Please carefully check the below properties(cardinality, selection && types) and bindings.
    1. Create a value node(Ex: ctx_vn_FileData) of cardinality 0..1 and selection 0...1
    2. Create a context attribute(Ex: ctx_va_FileResource) of 
        type "com.sap.ide.webdynpro.uielementdefinitions.Resource" under this node.
    3. Check you binded this context attribute to resource property of FileUpload UI element.
    4. Now you can get the value of this resource using below code.
    IPrivateUploadFileKM_View.ICtx_vn_FileDataElement element = wdContext.currentCtx_vn_FileDataElement();
    IWDResource resource = element.getCtx_va_FileResource();
    4. You can get the resource(file) name & resource(file) extension using below code.
    //Read the File
    InputStream stream = resource.read(true);
    String resourceName = resource.getResourceName();
    String resourceExtn = resource.getResourceType().getFileExtension();
    Check that you did all these as it is??
    Regards,
    Charan

  • File Upload Demo not working

    I downloaded the source for this from OTN for 6i & recompiled the forms & libraries in 9i & tried to run after following all the steps mentioned in the readme doc but the form does not show up, the jinitiator java console window shows loading f90all...jar file & UploadClient.jar.sig file & stops
    i have registered PJC using JavaKey as mentioned in the doc & also set the class path in the default.env file pointing to orahome/jdk/jre/bin/classic.
    Would any one throw light on what has gone wrong???
    Mahesh

    If you install the 9i demos from OTN, they include the fileupload sample and the installation does all the setup for you including the classpath etc.

  • File upload example - browser freezing

    We implemented the web file upload example in Forms 6i a while ago. It seemed to work however if we load several files in one session the browser freezes - has anyone else experienced this problem? Can anyone help?
    Many Thanks
    Steve

    We implemented the web file upload example in Forms 6i a while ago. It seemed to work however if we load several files in one session the browser freezes - has anyone else experienced this problem? Can anyone help?
    Many Thanks
    Steve

  • File conversion is not working

    File conversion is not working.

    Using online services and it simply times out. I login and upload the file
    I want converted and it takes 5 mins or longer and then simply says the
    file conversion failed.
    I got one file to work, but it took like 12 tries.
    Very annoying and it's impossible to call and get a tech person to help.
    On Tuesday, February 11, 2014, PECourtejoie <[email protected]

  • I keep getting the message: "what should firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    I keep getting the message: "what should Firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    cor-el,
    Thanks for your prompt reply. However, the sources you gave do not seem to apply exactly to my situation. I have attached some screenshots that show what the dialogue box looks like for a pdf download, and what my settings in the Apps panel of Options are. You will note in the first screenshot that I have checked the box to handle this file type automatically; however, the next time I try to download a file of that type, the same dialogue box appears looking exactly like the one shown, so checking the "automatic" option appears to do nothing. The files to be downloaded from my Gmail messages are not generic or altered file types - they are shown as pdf, doc, docx, etc. So while your intent was good, your post did not help. Thanks anyway.

  • Problems with  File Upload Example

    Hi,
    I follwed all the steps as in File Upload Example, still I am getting this exception,
    Exception occured in J2EEC Phase
    com.sun.enterprise.deployment.backend.IASDeploymentException: Deployment Error -- Error loading deployment descriptors for _linnfdb -- There is no web component by the name of uploadFile here.
    Has any one got a clue???????????
    Any help will be greatly appreciated.
    cheers
    kush

    Hi,
    There is a relevant topic on EA discussion.
    Topic:mini-mini FileUpload tutorial
    https://feedbackprograms.sun.com/project/forum/thread.html?cap={3F4DA363-16D3-4D4C-920C-992ECB054B6D}&forid={CC6B8562-F896-4A44-ACB6-4684BDD05E19}&topid={7EDEB723-F414-4DE5-9B8E-A4A4C625474E}
    Hope this helps.
    Please post messages related to Creator 2 EA at the feedbacks programs portal. The URL is:
    https://feedbackprograms.sun.com/login.html
    Thanks,
    RK.

  • File sharing is not working from pc to imac os x 10.9.2

    file sharing is not working from pc to imac os x 10.9.2

    Hello there Karen,
    It sounds like you are having to power cycle your modem to get internet back every single day. We can start by troubleshooting your Airport Express to help isolate the issue. I would first perform a Soft Reset, then test the issue again. If needed as a last resort I would then perform a Hard Reset:
    Soft reset
    Connect the device to power and wait for it to complete its start up process. To learn more about the start up process, please see All about Wi-Fi base station Status Lights (LED).
    Press and hold the reset button with a pen, pencil, or straightened paperclip for 1 full second, then release it. The light (LED) will begin flashing amber, indicating that the device is in soft reset mode.
    From the AirPort menu bar item, choose the network created by the device (the network name does not change).
    Open AirPort Utility from Applications > Utilities.
    Select the base station, then click Edit (The Edit window will indicate that the base station is in Soft Reset mode).
    Move through the tabs to make changes to your passwords or other settings as needed, and click Update and Continue as required
    Quit AirPort Utility.
    Hard reset
    Press and hold the reset button with a pen, pencil, or straightened paperclip until you see the status light (LED) start to flash amber rapidly, which should occur after about five seconds.
    Release the button and the device will reset.
    Wait about a minute for the base station to finish restarting, then open AirPort Utility from Applications > Utilities.
    Select the base station from Other Wi-Fi Devices, then click Edit.
    Select the Other Options button.
    Select "Restore previous settings" and click Next until you get to the final window.
    AirPort Utility will indicate that Setup is complete. Click Done.
    Quit AirPort Utility.
    Resetting an AirPort base station FAQ
    http://support.apple.com/kb/ht3728
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • File manager still not working w 10.7.3combo

    Since installing lion (I started with 10.7.2) file manager is not working. Yes, I can force uit it and than it does but it is still very annoying and time consumin to do it 2-4 times a day. I was hoping that 10.7.3 will solv it. Than installed based on advice I received hee 10.7.3 compbo but the problem is still there.
    Do you know or have you run accross a thread that explains how to solve it?
    Advanced thats to anyone who can help
    Ruvy

    What is "file manager?"  Is that a piece of third-party software, or are you referring to the Finder?  If it's third-party software, you'll need to contact the developer for an update or fix.  If the Finder is not working (how is it not working?), then you could try some of the tips in Understanding upgrade nightmares.
    (Note that my pages contain links to other pages that promote my services, and this should not be taken as an endorsement of my services by Apple.)

  • HT1766 please help my ipad min is not working on the scren it says iPad disabled connect to itunes

    please help my ipad min is not working on the scren it says iPad disabled connect to itunes

    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    You may have to do this several times.
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just canceling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • Search help for cost center does not work after SP upgrade

    Hi,
    Create a shopping cart in SRM and go to the cost assignment tab. When click on the search help to enter a costcenter, we don't get any search help screen.
    Thanks

    Kindly check note: 1259735 Search help of generic account does not work
    Additionally Check the 5th question/answer of note 815849.

  • HELP! MY TRACKPAD IS NOT WORKING

    GUYS. PLS HELP. MY TRACKPAD IS NOT WORKING IM USING BB CURVE 9300. IM FROM THE PHILIPPINES. BUT MY MOM BOUGHT AT SAUDI ARABIA. TODAY, IM PLANNING TO GO IN A SERVICE CENTER IN ORTIGAS. AS PER CONVERSATION TO THE CELLPHONE TECHNICIAN. IT WILL COST 800. IS IT TOO EXPENSIVE? HELP! IS THERE ANY OTHER WAY AROUND???

    Use the tab key to navigate around the Bluetooth Assistance screen and the spacebar to enter/select.
    If the tab key doesn't move to all controls then press Control FN F7   one times and try the tab key again.
    Regards,
    Captfred

Maybe you are looking for

  • More than one computer iTunes sync

         I recently upgraded to a newer model of macbook pro.  My old one was 4 months too old to sync at all with my Iphone 5 (which is frustrating in itself).  When I'd gotten my iphone 5, I first synced it to my family's mac and transfered much of my

  • Time Capsule extremely slow recover

    Hi and tnxs for reading. Since my iPhoto Library has been corrupted, I am trying to test some old versions/backup by restoring them from my Time Capsule (2TB last version on the Apple Store), but unfortunately the process is extremely slow. My iPhoto

  • Can I use Text Layout Framework with Flex 3 SDK?

    Greetings, I have to develop a complex custom widget, with custom text wrapping behaviour. Text Layout framework seem to offer fine level of control, but we are trying to keep our project in Flash player 9, and therefore we are using Flex 3 sdk. Can

  • Using jquery to fade in validation messages in and out

    Hello, I am using spry validation on my form and I have it where it pops up a graphic when the validation happens. Now to dress it up better I would like those graphics to fade in and out depending if they meet the validaton or not instead of just di

  • Right side of the inspector?

    Is there a way to choose what to display on the right column? It use to show the Master strip, now it's on one of the sends... Can't figure out if there's any way to change it back or control that...