Request.getParameter() when uploading files

Hi, I need to upload files and do other works .. such that, in my html ..
<form name="composer" method="post" ENCTYPE="multipart/form-data">
<input type=hidden name="a" value="a">
<input type=File name=inputfile>
<inpu type=button name=Upload onClick='upload file'>
<inpu type=button name=otherStuff onClick='do other stuff'>
</form>
In the jsp for 'do other stuff', I have the following statement to get the value of a
String a = request.getParameter("a");
However, it returns 'null', if I erase the 'ENCTYPE' part from the html file, it works. How can I get it right?

If your ENCTYPE is multi-part/form-data, then there is another technichque to read the form parameters.
request.getParameter() won't work.
first u need to read the requenct explicitely and divide the contents into parameters, files etc. and then read the parameter values.
you can get a lot of stuff regarding this on web, like 'uploading files using jsp'.
have fun!!

Similar Messages

  • My firefox crashed when upload file on our web based application. This happen on two PC, even during firefox safe mode the problem still exist. But the problem

    Dear All,
    My firefox (version 23 on win 7) crashed when upload file on our internal web based application. This happen on two PC, even in firefox safe mode the problem still exist. So, my first conclusion the problem nothing to do with extension. here the crash ID https://crash-stats.mozilla.com/report/index/81220865-36c0-4e10-a484-6d27e2131023 and https://crash-stats.mozilla.com/report/index/86d2b779-9730-4d2c-b276-a86d42131023. I wonder if this happen because jquery modul in our web based application. But when I tried on my laptop, the problem dissapear. I tried to replicate same situation on different server, I mean I put the exact same application source to other server, never meet the same problem. Thus, I suspect may be it related to antivirus that installed in our network which is kaspersky. I am googling, never meet the clue.
    If you meet the same problem, please help me.
    I am so sorry for my poor english.
    Him Him

    The crashes are a problem with the winhadnt.dll file (OCular Agent from TEC Solutions Limited) as you can see in the crash reports.
    *http://www.freefixer.com/library/file/winhadnt.dll-52397/

  • Error occurred when uploading file (unknown file format) in t.code SFP

    Hi,
    According to SAP Note 1465628 - ESI Limit increased and length of temp. ESI no increased, when we are doing Step 4. PDF form changes (valid for ECC 6.0 and above)....and point (i)...in transaction SFP (From - HR_IN_ESI_005_99), system shows the below message.
    Error occurred when uploading file (unknown file format)
    Message no. FPUIFB068
    Plz guide..

    Hi Anil,
    Refer following links :
    Re: Adobe Form assignment
    Adobe Uploading form error unknown file forma
    Hope this will help.
    Regards,
    Vivek

  • Error when uploading file : Return code = 6 in LSMW

    Hello All,
    Getting the bleow mentioned error in LSMW.
    Error when uploading file Return code = 6 )
    Is it related to access. please suggest.

    did you define the file in step 7 without any error and allocate in step 8 without any error before? 
    I mean in the same system where you execute the read step.
    Make sure you have the file not open when you execute the read step.

  • Error when uploading file in TA: SFP (Form Builder)

    Hi Everybody,
    i am having a problem in Transaction SFP (Form Builder)
    I download a Form Objekt and it was written correct in my Local Drive with the ending xxxx.XML.
    Then i wanted to Updold the file, then it says:
    "Error occurred when uploading file (unknown file format)
    Message no. FPUIFB068"
    we are using ERP2005 Rel. SAP ECC 6.0
    Hope to hear a solution for my problem.
    thank + regards
    I.Ismail

    Hi All,
       Even I faced the same issue whenI tried to upload the form which was developed in Standalone Live cycle designer and I wanted to upload the same into SAP SFP. Initially I felt that this kind of activity might be supported by SAP Adobe Live Cycle deisgner, But it says the Error wron file foramt....
    So what I felt is instead of trying to upload the form by using the tool  provided by SAP... I  directly copy pasted the XML source code into the SFP newly ccreated blank form. ya..it displays some warning messages...But still since I used a Printable form so I could not face any issue...Might be there would be some effect of this warning in Interactive forms.....
    But for copying this you donot want to be a expert in the XML area.. All I did was just copied the source xml file from the line <TEMPLATE> tag  and till the end  and I replaced in the target xml fiel from the same tag from the top <TEMPLATE>....
    and save and activate.....
    Regards
    Pavan
    Edited by: Pavan Bhamidipati on Mar 25, 2011 11:58 AM

  • When "Upload File" , show the IE error page

    question: when "Upload File" , show the IE error page. How to soluve the problem?

    Duplicate post.
    when "Upload File" , show the IE error page
    when "Upload File" , show the IE error page

  • Error when uploading file :( Return code = 6 )

    Hello All,
    Getting the bleow mentioned error in LSMW.
    Error when uploading file Return code = 6 )
    Is it related to access. please suggest.

    Hi,
    If the Sy-Subrc is 0 then Success,
             Sy-SUBRC is 4 then failure,
             Sy-SUBRC = 6 then the user might be not access to read the file.
    This is due to authorization issue.

  • Illegal State Exception when uploading file

              I am getting the following error in a jsp page that does a upload
              of a file. My enviorment is WL6.0 SP1 and it seems to occur
              when I do a pageContext.forward("xxx.jsp")
              java.lang.IllegalStateException: One of the getParameter family
              of methods calle
              d after reading from the ServletInputStream(), can't mix these
              two!
              at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(ServletR
              equestImpl.java:664)
              at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Servlet
              RequestImpl.java:585)
              at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Servlet
              RequestImpl.java:578)
              at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
              cherImpl.java:124)
              at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:111
              at jsp_servlet._processagencylogoselection._jspService(_processagencylog
              oselection.java:444)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:213)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:1265)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:1622)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              Any help would greatly be appreciated.
              

    Mike,
              You should not use request.getParameter before getInputStream as per servlet spec.
              Mike G wrote:
              > Yes I do within a servlet, but I don't understand why this would
              > occur though. Maybe it's because the content type is
              > multipart/x-mixed-replace;boundary=End????
              >
              > Mettu Kumar <[email protected]> wrote:
              > >Did you use request.getParameter before calling request.getInputStream
              > >?
              > >Looks like this is causing the error.
              > >
              > >Kumar.
              > >
              > >Mike G wrote:
              > >
              > >> I am getting the following error in a jsp page that
              > >does a upload
              > >> of a file. My enviorment is WL6.0 SP1 and it seems
              > >to occur
              > >> when I do a pageContext.forward("xxx.jsp")
              > >>
              > >> java.lang.IllegalStateException: One of the getParameter
              > >family
              > >> of methods calle
              > >> d after reading from the ServletInputStream(), can't
              > >mix these
              > >> two!
              > >> at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(ServletR
              > >> equestImpl.java:664)
              > >> at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Servlet
              > >> RequestImpl.java:585)
              > >> at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(Servlet
              > >> RequestImpl.java:578)
              > >> at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispat
              > >> cherImpl.java:124)
              > >> at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:111
              > >> )
              > >> at jsp_servlet._processagencylogoselection._jspService(_processagencylog
              > >> oselection.java:444)
              > >> at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              > >> at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              > >> pl.java:213)
              > >> at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              > >> rvletContext.java:1265)
              > >> at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              > >> pl.java:1622)
              > >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              > >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              > >> >
              > >> Any help would greatly be appreciated.
              > >
              

  • Error when uploading file

    Hi all,
    we just have upgraded our EREC system to Enhancement Package 4, and we have now lot's of issues when the candidates try to upload documents in their cockpit. Even if the type of document is ok or the file size is fine also, there is the following error message : Error when uploading; the file name is invalid, or the file is too big
    We have this error with lot's of web browser : IE6-IE7-IE8-Firefox 2.xx-Firefox 3.6-Safari 3 and 4-Chrome
    It is impossible to debug this error, there is no stop at the breakpoints.
    Did anyone have any suggestion ?
    Our system information :
      EREC 604 SP 5
      NW    701 SP 5
    Thanks in advance
    Dominique

    Hello Sai,
    we already put an external breakpoint on the first step of the method called by the button, but it does not stop on this breakpoint.
    It looks like the error message is generated by javascript or is in the cache, but it is not possible to find where.
    WD component : HRRCF_C_ATTACHMENTS_UI
    View : VW_ATTACHMENT_DETAIL
    Method : ONACTIONAPPLY
    Thanks for your help
    Dominique

  • Problem when upload file

    Hello everybody, i need to upload a file to a server and i use the following code:
    DiskFileUpload upload=new DiskFileUpload();
    List items=upload.parseRequest(request);
    Iterator itr=items.iterator();
    while(itr.hasNext()) {
    FileItem item=(FileItem)itr.next();
    if(item.isFormField()) {
    String fieldName=item.getFieldName();
    if(fieldName.equals("pagina")) {
    pagina=item.getString();
    if(fieldName.equals("posizione")) {
    posizione=item.getString();
    if(fieldName.equals("link_pub")) {
    link_pub=item.getString();
    else {
    path=application.getRealPath("/")+"pubblicita"+"/"+pagina+"/"+posizione;
    File fullFile=new File(item.getName());
    image=item.getName();
    savedFile=new File(path+"/"+fullFile.getName());
    link_foto=path+"/"+fullFile.getName();
    item.write(savedFile);
    it is working on local machine (localhost) but i publish the site on the server and i have this problem:
    type Status report
    message /home/242654543544/www/web/pubblicita/home/1/publicita.gif (Permission denied)
    description The requested resource (/home/242654543544/www/web/pubblicita/home/1/publicita.gif (Permission denied)) is not available.
    Help me......

    How i can give the right permission for upload the file?I try to give the 777 permission to the www/web/ folder but i don thave the permission.
    Have i speak with the provider of the hosting?

  • Start Workflow when Upload File using drag and drop

    Hi,
    I am working with SharePoint 2013.
    I have a workflow needed to be started and run only once after a document is uploaded into the document library. The document library has
    required custom columns with default values. If I set workflow starting option as 'On Created', when user got redirected to the edit form and click 'Save', there would be error as
    "The <filename> has been modified by <user> on <datetime>". Besides the unwanted error dialog, the metadata entered by users are not reflected. I understand the issue is because the workflow had already started before
    the edit form showed and it modified the file.
    So I changed the starting option to 'On Changed", created an additional column to record if the workflow has been run or not to avoid running the whole workflow more than once. This works fine for normal upload. However on drag and drop, the
    event 'On Changed' is not triggered and the workflow is not started. I checked the version of the file but in both normal upload and drag and drop, there is another version after the first version. But
    only the version of normal upload triggers the workflow.
    I read an article about some Mode = Upload on the edit form.
    https://go4answers.webhost4life.com/Example/workflow-triggered-during-upload-user-149297.aspx
    It seems that the Mode = Upload is not there anymore for normal upload, but it's still there for drag and drop. Not sure about this
    Is there a solution for my case. Basically I want to start the workflow only once when the document is uploaded normally or via drag and drop. For normal upload, user can
    edit the custom metadata right after they browse the file. For drag and drop, the
    metadata will be set as default values.
    Thank you.

    I'm still researching your issue, but as an interesting note... This is an issue only when I use a 2013 style workflow. I do not get the error when using a 2010 style workflow.
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • Drag and drop not working when uploading file using safari

    why i cannot drag and drop any file when using safari , and what happens the file auotmatically open while i need to upload it only , extra for that , i cannot write  any remark or fill a space while using website related to my work.
    my work is to upload drawing files using dwf file to a website so the other parties can review and give me review , and then i reply to the remark at the same place and make meeting through the same site.
    please any body can give any way to correct my mac.
    latelly i installed win7 only to use it for that website , and iam now changing from mac to win whenever i want to work , this not acceptable to me because it is waste of time beside i like the mac and it working with other application but not for safari.

    why ?
    I'm sorry, but every OS is different.  You cannot expect all features of one to be in another.  Or alternatively, for similar features, be done it the exact same way. 
    It looks to me after a quick google search that winexplorer is basically the moral equivalent of the mac's finder to present the file system in different ways.  The OSX Finder also has alternative views of the file system, i.e., icons, list, columns.  Experiment with the list and column views and see if one of them are more to your liking.
    As for winexplorer on the mac.  I don't know if this simulates it or not but there is a program called Macintosh Explorer so check that out as well.
    And finally, in the end, as I said in my earlier post, no matter what, nothing on the mac is going to change what I believe you think you can do and drop a file on a browser window and expect it to upload.

  • Http 401 error when uploading file to content services

    Hi,
    When i try to upload a document, the document is created in the folder with empty content and i have the 401 http error.
    Someone can help me to resolve thise problem.
    Thank's for advance.

    I found the response to the problem. I summarize the solution in the following point :
    1- when you connect to a standalone content services server via the webservices api, you get a single String as cookie and to upload a document to server you use the same single cookie.
    2- bu when you connect to cluster content services via the webservices api, you get an Array of String as cookies and to upload a document to server you need to transform the array of cookie into a single String cookie to be able to be authenticated by the http server, look to the following code
    String cookie="";
         for(int i=0;i < connection.getCookie().length;i++) {
              cookie = cookie + connection.getCookie() +";";

  • Hiii capturing error when uploading file from sap to Server

    hiii
    i am taking data from an internal table which is as follow
    ITAB:
    colA(35) type c
    colB(35) type c
    when doing opendataset
    OPEN DATASET lv_directory FOR OUTPUT IN TEXT MODE ENCODING UTF-8.
    spliting my itab by the delimiter "|"
    i need file already exist i must not over overwrte the file i must throw an error but how do the open dataset for output will overwrite the file how do i prevent that.  how can i check that a file of that name exist.
    do i try to open dataset for input first then if sy-subrc EQ 0 it meant that a filename already exist

    Hello,
    Do something like this:
    DO.
      READ DATASET file INTO <hex_container>.
      IF sy-subrc = 0.
    " File exists
      ELSE.
        OPEN DATASET....
      ENDIF.
    ENDDO.
    Regards.

  • LSMW Error When Uploading file (Return Code = 7)

    Hi all,
    I got this message in step 9 'Read Data'. I've checked everything about file i'm doing as always. The fle is not open during the steps and file format is Text (tab delimited). Could you please tell me what is the problem?
    Regards

    RC 7 = unknown error
    you can just be sure that it is not one of the other listed errors:
    file_open_error               = 1
    file_read_error               = 2
    no_batch                      = 3
    gui_refuse_filetransfer       = 4
    invalid_type                  = 5
    no_authority                  = 6
    unknown_error                 = 7
    bad_data_format               = 8
    header_not_allowed            = 9
    separator_not_allowed         = 10
    header_too_long               = 11
    unknown_dp_error              = 12
    access_denied                 = 13
    dp_out_of_memory              = 14
    disk_full                     = 15
    dp_timeout                    = 16
    OTHERS                        = 17
    you may have to debug the read program. Click personal menu, then activate the box in from of display read program.
    you get a new step 9, which gives you the source for the read program. there you can set breakpints for the debugger, which will start when you execute the read step (which is then step 10)

Maybe you are looking for