Upload file problem

hi......
i am using struts.....
i want to upload a file from client to server......but i am using enctype="multipart/form-data" in my jsp........it prompt out a err message
javax.servlet.ServletException: Servlet execution threw an exception
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:275)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
     at com.entertainment.system.EntertainmentFilter.doFilter(EntertainmentFilter.java:70)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
     at java.lang.Thread.run(Thread.java:595)
please help.....thank you

at com.entertainment.system.EntertainmentFilter.doFilter(EntertainmentFilter.java:70)That is your own filter I'm assuming and line 70 of that filter is causing your exception. So check out that line to see what the offending code is.
I'm guessing that line does something with a parameter you retrieved, which is most likely null. A multipart form requires an API that can parse a multipart request, you cannot get file uploads (or other multipart fields) using the HttpServletRequest. I suggest you try out Apache commons FileUpload.
http://jakarta.apache.org/commons/fileupload/

Similar Messages

  • Again JSF upload file problem.

    I am using My Faces to upload files. There is a way to limit the size of uploaded files.
    <filter>
            <filter-name>ExtensionsFilter</filter-name>
            <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
            <init-param>
                <param-name>uploadMaxFileSize</param-name>
                <param-value>7m</param-value>
            </init-param>
            <init-param>
                <param-name>uploadThresholdSize</param-name>
                <param-value>100k</param-value>
            </init-param>
        </filter>When I try to upload bigger than 7 MB file, I receive the following log.
    2007-05-23 13:58:20,796 [http-8080-Processor24] INFO org.apache.myfaces.component.html.util.MultipartRequestWrapper - user tried to upload a file that exceeded file-size limitations.
    org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because it's size exceeds allowed range
         at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:317)
         at org.apache.myfaces.component.html.util.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:70)
         at org.apache.myfaces.component.html.util.MultipartRequestWrapper.getParameter(MultipartRequestWrapper.java:151)
         at org.apache.myfaces.context.servlet.RequestParameterMap.getAttribute(RequestParameterMap.java:39)
         at org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:87)
         at org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getTreeStructureToRestore(HtmlResponseStateManager.java:181)
         at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:142)
         at org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:181)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255)
         at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:113)
         at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:94)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Thread.java:595)
    By now, OK. Here comes the problem: The behavior of application is correct after this, which I can see from the rest of my log, BUT my browser continue to say that the request is being processed and that the page continues to load, which is not true, and I can not find where is the reason.
    Do you have any idea?

    Check this code if it is useful
    REPORT  ZSRK_046                                .
    DATA : FIR_FILE(512) VALUE '
    iltlvp01.t.st.corp\DE_Development\EP 6\Port\dept\Program Office\TEST.json'.
    TYPES: BEGIN OF TP_DATA_TAB,
           TEXT(512),
           END OF TP_DATA_TAB.
    DATA : DATA_TAB TYPE STANDARD TABLE OF TP_DATA_TAB,
           WA_DATA_TAB LIKE LINE OF DATA_TAB .
    DATA : WA(512).
    OPEN DATASET FIR_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC EQ 0.
      DO.
        READ DATASET FIR_FILE INTO WA.
        IF SY-SUBRC NE 0.
          EXIT.
        ENDIF.
        WA_DATA_TAB-TEXT = WA.
        APPEND WA_DATA_TAB TO DATA_TAB.
        CLEAR : WA_DATA_TAB, WA.
      ENDDO.
    ENDIF.
    LOOP AT DATA_TAB INTO WA_DATA_TAB.
      WRITE : / WA_DATA_TAB-TEXT.
    ENDLOOP.

  • MULTIPLE UPLOAD file problem

    Hello,
    I have a problem with multiple upload file tool.
    Because my server need, in order to upload files in its folders, to be logged only with ftp user (that is unique).
    Now, I need that when I upload a file its name will be stored on db table "file_name". But in order to put data in database i have tobe logged also with user that is allowed to access on mysql db.
    So I understand that I should nedd to types of authentication at the same time...
    I think it depends on my type of hosting that is windows, and there is not the possibility to change CHMOD, so the error when I try to upload a file is that the folder has not write permissions...
    Any suggestions?
    Thanks a lot
    ascaro231
    Italy

    Hi ascaro231,
    wow, that is one bag of problems on the remote side :-(
    to be logged only with ftp user
    although PHP itself provides native FTP functions
    (e.g. for uploading files and also changing folder & file permissions), ADDT´s file upload features don´t support this protocol
    and there is not the possibility to change CHMOD
    CHMOD *will* have to be supported by your host, because this is how ADDT changes folder & file permissions.
    Well, to me it seems that your host doesn´t provide some very basic and truly common-standard PHP settings -- and honestly, disabling the regular PHP file upload features is ridiculous.
    Any suggestions?
    go for a better host -- this is just inacceptable.
    Are you hosting with "Aruba" BTW ? They have both Windows and Linux hostings, and AFAIK it´s possible to switch the hosting type.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Uploading file problem in JSF using myfaces-extensions.jar.

    Dear All,
    I'm new to JSF and trying to upload files using myfaces-extensions-1.0.9.jar and commons-fileupload-1.2.1.jar.
    I have upload.jsp and result.jsp and a bean named MyBean.java. after press the submit button it should navigate to result.jsp and shows some info.
    My problem is that it successfully run but when submit its not working and remain same page.
    upload.jsp:
    {<%@page contentType="text/html" pageEncoding="windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <f:view>
    <h:form id="MyForm" enctype="multipart/form-data" >
    <h:messages globalOnly="true" styleClass="message"/>
    <h:panelGrid columns="3" border="0" cellspacing="5">
    <h:outputLabel for="myFileId" value="File: "/>
    <x:inputFileUpload id="myFileId"
    value="#{myBean.myFile}"
    storage="file"
    required="true"/>
    <h:message for="myFileId"/>
    <h:outputLabel for="myParamId" value="Param: "/>
    <h:selectOneMenu id="myParamId"
    value="#{myBean.myParam}"
    required="true">
    <f:selectItem itemLabel="" itemValue=""/>
    <f:selectItem itemLabel="MD5" itemValue="MD5"/>
    <f:selectItem itemLabel="SHA-1" itemValue="SHA-1"/>
    <f:selectItem itemLabel="SHA-256" itemValue="SHA-256"/>
    <f:selectItem itemLabel="SHA-384" itemValue="SHA-384"/>
    <f:selectItem itemLabel="SHA-512" itemValue="SHA-512"/>
    </h:selectOneMenu>
    <h:message for="myParamId"/>
    <h:outputText value=" "/>
    <h:commandButton id = "test" value="Submit"
    action="#{myBean.processMyFile}"/>
    <h:outputText value=" "/>
    </h:panelGrid>
    </h:form>
    </f:view>
    faces-config.xml
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config version="1.2"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
    <managed-bean>
    <managed-bean-name>myBean</managed-bean-name>
    <managed-bean-class>
    com.devsphere.articles.jsfupload.MyBean
    </managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/upload.jsp</from-view-id>
    <navigation-case>
    <from-outcome>OK</from-outcome>
    <to-view-id>/result.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    Can anybody there for help me whats the problem. I'm using netbeans 6.1 with bundled tomcat 6.0 and no error is shown.

    Hey All,
    I've got my solve. Now Its working.

  • Urgent !!!!!!!!!!!!!Uploading File problem

    Hi I stucked on a problem...... I want to upload file from html page....On this page I want only a upload button so that when I click on this button file will upload from my client m/c to server m/c.... I have code n all but browse button on html page....now I want to remove this browse button n want to give the file path somewhere in the code itself........so that on html page there will only the uplod button and by click on this button file will upload from client to server.......server path already there in code.....Please do the needful  Abhishek  I m putting the code here:-  FileUpload.java  /* upload-FileUpload.java  NOTE: This file is a generated file. Do not modify it by hand! */  package upload;   //custom imports for FileUpload //add your custom import statements here  import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import com.oreilly.servlet.MultipartRequest; import java.util.*;   public class FileUpload extends javax.servlet.http.HttpServlet { protected boolean create() throws java.lang.Exception {  return true; }   public FileUpload() { // Constructor.  } private void unhandledEvent( String listenerName, String methodName, java.lang.Object event ) {  } /** * destroy Method */  public void destroy() { super.destroy(); // TODO: implement } /** * doGet Method */  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("abhishek"); response.setContentType( "text/html" );  PrintWriter out = response.getWriter();  out.println("<HTML>");  out.println("<HEAD><TITLE>FileUpload</TITLE></HEAD>");  out.println("<BODY>");  out.println("<H1>FileUpload</H1>");  out.println("Hello World!");  out.println(" Default Implementation From PowerJ  ");  out.println("</BODY></HTML>");   // TODO: implement } /** * doPost Method */  protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {   PrintWriter out = response.getWriter();  try{ response.setContentType("text/html"); out.println("<HTML>"); out.println("<head><Title>Decoded Uploaded File</title><head>");  out.println("<body>"); out.println("<H1>UploadFile</h1>");  // path must be absolute to upload dir // This is the decoder class that extracts the parameters and transfer file // request argument = Http input stream // c:\\temp\\upload = directory to save file // 15*1024*1024 = 15mb max size file MultipartRequest multi = new MultipartRequest(request, "c:\\temp\\upload",15*1024*1024);   // Lists form parameters out.println("Params:"); Enumeration params = multi.getParameterNames(); out.println("<pre>");  while (params.hasMoreElements()) { String name = (String)params.nextElement(); String value = multi.getParameter(name); out.println(name + " = " + value); }  out.println("</pre>");   // Show details of uploaded file out.println("Files:"); Enumeration files = multi.getFileNames();  out.println("<pre>"); while (files.hasMoreElements()) { String name = (String)files.nextElement(); String filename = multi.getFilesystemName(name); String type = multi.getContentType(name); File f = multi.getFile(name); out.println("name: " + name); out.println("filename: " + filename); out.println("type: " + type); if (f != null) { out.println("f.toString(): " + f.toString()); out.println("f.getName(): " + f.getName()); out.println("f.exists(): " + f.exists()); out.println("f.length(): " + f.length()); out.println(); } out.println("</pre>"); }  }catch (Exception e){ out.println("<pre>"); e.printStackTrace(out); out.println("</pre>"); } out.println("</body></html>"); } /** * init Method */  public void init(ServletConfig config) throws ServletException { super.init(config); // TODO: implement } /**************************************** * data members ****************************************/   // add your data members here }  --------------------------------------------------------------------------------------------------  UploadFile.html  <html>  <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>File Upload using EAS</title> </head>  <body>  <form method="POST" enctype="multipart/form-data" action="upload/FileUpload">  <b>File Upload using EAS </b>    Select file to send: <input type="file" name="name" size="30">    Your Name: <input type="input" name="yourname" size="20">     <input type="submit" value="Send File" name="submit">   </form>  </body>  </html> ----------------------------------------------------------------------------------------------  You can download the oreilly files from :- (same code is also here)  http://www.sybase.com/detail?id=1011664

    I m putting the code again with code tags:-
    code is here
    FileUpload.java
    package upload;
    //custom imports for FileUpload
    //add your custom import statements here
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import com.oreilly.servlet.MultipartRequest;
    import java.util.*;
    public class FileUpload extends javax.servlet.http.HttpServlet
    protected boolean create() throws java.lang.Exception
    return true;
    public FileUpload()
    { // Constructor.
    private void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
    * destroy Method
    public void destroy()
    super.destroy();
    // TODO: implement
    * doGet Method
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    System.out.println("abhishek");
    response.setContentType( "text/html" );
    PrintWriter out = response.getWriter();
    out.println("<HTML>");
    out.println("<HEAD><TITLE>FileUpload</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<H1>FileUpload</H1>");
    out.println("Hello World!");
    out.println("
    Default Implementation From PowerJ
    out.println("</BODY></HTML>");
    // TODO: implement
    * doPost Method
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    PrintWriter out = response.getWriter();
    try{
    response.setContentType("text/html");
    out.println("<HTML>");
    out.println("<head><Title>Decoded Uploaded File</title><head>");
    out.println("<body>");
    out.println("<H1>UploadFile</h1>");
    // path must be absolute to upload dir
    // This is the decoder class that extracts the parameters and transfer file
    // request argument = Http input stream
    // c:\\temp\\upload = directory to save file
    // 15*1024*1024 = 15mb max size file
    MultipartRequest multi = new MultipartRequest(request, "c:\\temp\\upload",15*1024*1024);
    // Lists form parameters
    out.println("Params:");
    Enumeration params = multi.getParameterNames();
    out.println("<pre>");
    while (params.hasMoreElements()) {
    String name = (String)params.nextElement();
    String value = multi.getParameter(name);
    out.println(name + " = " + value);
    out.println("</pre>");
    // Show details of uploaded file
    out.println("Files:");
    Enumeration files = multi.getFileNames();
    out.println("<pre>");
    while (files.hasMoreElements()) {
    String name = (String)files.nextElement();
    String filename = multi.getFilesystemName(name);
    String type = multi.getContentType(name);
    File f = multi.getFile(name);
    out.println("name: " + name);
    out.println("filename: " + filename);
    out.println("type: " + type);
    if (f != null) {
    out.println("f.toString(): " + f.toString());
    out.println("f.getName(): " + f.getName());
    out.println("f.exists(): " + f.exists());
    out.println("f.length(): " + f.length());
    out.println();
    out.println("</pre>");
    }catch (Exception e){
    out.println("<pre>");
    e.printStackTrace(out);
    out.println("</pre>");
    out.println("</body></html>");
    * init Method
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    // TODO: implement
    * data members
    // add your data members here
    }UploadFile.html
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>File Upload using EAS</title>
    </head>
    <body>
    <form method="POST" enctype="multipart/form-data" action="upload/FileUpload">
    <b>File Upload using EAS </b>
    Select file to send: <input type="file" name="name" size="30">
    Your Name: <input type="input" name="yourname" size="20">
    <input type="submit" value="Send File" name="submit">
    </form>
    </body>
    </html>[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Upload file problems

    I have a jsp form which is used to upload file...following is the code..
    <form name='fileUploadFrm' METHOD="POST" ENCTYPE="multipart/form-data" action='/myServlet?prma=1&prmb=2' onSubmit="return validateForm(this);">
    <H2>Upload File <H2>
    <table class="tabledatadisplay" border='0' cellpadding='0' cellspacing='3'>
    <tr><td>File Name/ID:</td><td> <input name='fileName' type='text'></td></tr>
    <tr><td>File Description:</td><td><input name='fileDesc' type='text'></td></tr>
    <tr><td>File:</td><td> <input name='fileContent' type='file'></td></tr>
    <tr><td colspan='2'> </td></tr>
    <tr><td> </td><td><input name='attach' type='submit' value=' Upload File ' onClick="return confirm('Are you sure you want to upload the file.');"></td></tr>
    </table>
    </form>
    intially i used two hidden fields prma and prmb..it didn't work so I changed the action string to include both the hidden fields...
    Now I get null values when I use the following code in myServlet
    request.getParameter("fileName");
    request.getParameter("fileDesc");
    I do get the file, i mean from the file input element
    I am using multiparser etc..in myServlet, I could able to read the contents and save it to database, but I couldn't able ot retrieve the text field and hidden field values in myServlet
    strange...can't figure out wy it is so????
    someone pls help me with this...

    Hi I am also working on the same problem and my next task is to display the contents to the browser and give him an option to either only open the document or save it to hard disk. I am doing it through setting the response.setContentType(content-disposition, attachment, filename") but it does not display the contents, it shows the dialog box but not the contents. please help me if u can...i m sending u some helping code..
    PreparedStatement preparedStatement2 =
    conn.prepareStatement("SELECT content,filename FROM tab_file );
    ResultSet resultSet = preparedStatement2.executeQuery();
    while(resultSet.next())
    Blob blob = resultSet.getBlob(1);
    byte [] b = blob.getBytes(1, length );
    response.setHeader("Content-Disposition","attachment; filename=untitled.java");
    ServletOutputStream servletOut = response.getOutputStream();
    servletOut.write(buf);
    servletOut.close();
    thnx

  • Visual Web JSF Portlet Upload file Problem in Websynergy

    Hello,
    I am using Websynergy milestone 3 release. I have tried to build AS A PORTLET the sample code, "Uploading Files in NetBeans Visual Web JSF Applications" (http://www.netbeans.org/kb/60/web/intro.html) using netbeans 6.5. The solution deploys successfully but unfortunately, the file Upload control does not work in the websynergy portlet environment. No file seems to be uploaded. The same code works very well in non-portlet environment. Is there a work-around for the Portlet environment?
    Looking forward to some help!
    Pius

    Hello,
    I am using Websynergy milestone 3 release. I have tried to build AS A PORTLET the sample code, "Uploading Files in NetBeans Visual Web JSF Applications" (http://www.netbeans.org/kb/60/web/intro.html) using netbeans 6.5. The solution deploys successfully but unfortunately, the file Upload control does not work in the websynergy portlet environment. No file seems to be uploaded. The same code works very well in non-portlet environment. Is there a work-around for the Portlet environment?
    Looking forward to some help!
    Pius

  • Uploading files problem.

    I have got a confusion in uploading files from user machine.
    we use <input type='file' name='fileName'/> tag for that.
    now at server side how we get the file:
    request.getParameter('fileName'); ?
    if yes then:
    but getParameter function returns a string, and a file data (eg image file) can't represented as a string.
    if no then:
    what function of request object we should use for that purpose.
    Now my second query is I have to get the size of the image, how will I be doing that.
    Please help me in this context.
    Thanks in advance for any help.

    Hello,
    Uploading file is a special request of HTTP.
    You have to handle the request a different way.
    Check on the JSP / Servlet forum for more information.
    Regards,
    Sebastien Degardin

  • Tricky upload file problem

    Hi,
    I have created a page to allow people to upload a file, OR
    just insert the url of the file. I am getting errors when I choose
    the option not upload the file.
    The first page has two input fields, one is text and the
    other is file - they both go to the same page. And I use
    enctype="multipart/form-data" in the form header.
    The second page checks to see if the form variable containing
    the file name exists - if it does, it loads the file. If not, then
    it just uses the url supplied in the text field.
    I can upload a file ok, but when I don't want to upload a
    file, and just enter the url, it comes back with an error. Is what
    I am trying to do possible, or do I need two different forms with
    two different destination pages??

    quote:
    Originally posted by:
    cakesy
    Hi,
    I have created a page to allow people to upload a file, OR
    just insert the url of the file. I am getting errors when I choose
    the option not upload the file.
    The first page has two input fields, one is text and the
    other is file - they both go to the same page. And I use
    enctype="multipart/form-data" in the form header.
    The second page checks to see if the form variable containing
    the file name exists - if it does, it loads the file. If not, then
    it just uses the url supplied in the text field.
    I can upload a file ok, but when I don't want to upload a
    file, and just enter the url, it comes back with an error. Is what
    I am trying to do possible, or do I need two different forms with
    two different destination pages??
    Assuming you are doing as you have actually indicated, you
    pretty much figured out the problem already, but I'm not certain
    you realize it.
    With the exception of checkboxes (
    and some weird radio button configs) all form fields
    exist whether they are blank or not.
    What you should be doing on your action page is checking to
    see
    if the fields are blank,
    not whether they exist. Make sure you use the TRIM function
    when you do this as well so it's not possible for people to submit
    the field with just a space in it.
    <CFIF TRIM(fileformfield) NEQ "">
    do action for file upload
    </CFIF>
    <CFIF TRIM(urlformfield) NEQ "">
    do action for url addition
    </CFIF>
    You could use a CFELSE in there, but I prefer to test for
    either possibility since (
    theoretically) the form fields could be submitted with
    blanks in each of them. Also, (theoretically) they could submit the
    form with both fields completed, so then you may also want to
    incorporate some cross-testing so that if both are filled out, you
    either choose one as the default, or you send an error back to the
    user to choose one or the other.

  • "Your Mac OSX startup disk has no more space available for application memory" - uploading files problem

    Hi everyone,
    I'm running a late-2012 27 inch iMac - 3.4GHz Intel Core i7, 32GB 1600 MHz DDR3 with the 3TB fusion drive, OS 10.8.4. At present there is 1.92TB of available storage.
    I have received this message "Your Mac OSX startup disk has no more space available for application memory" just before a full on crash multiple times in the past couple of days whilst using WeTransfer to send over some large files (500MB+). The applications I have had open at the time have been: Activity Monitor, App Store, Firefox, and Finder. Over the course of uploading the files, the active system memory has gone from 1.04GB and steadily increased until it more or less maxes out around 29GB, at which point the Page Outs rocket up to around 40GB/s and the swap memory fills up pretty quickly until the computer basically can't take any more and blacks out.
    This is a pretty new thing, haven't really had an issues before. My main software used: Sibelius 7 & Logic Pro X. I've also recently started working with Final Cut Pro X, which seems to have been struggling at points. I've tried closing everything, restarting the computer and not opening anything (specifically NOT FCPX) before attempting an upload. I've even gone so far as to remove FCPX from my system, and yet the problem is still recurring. Both "kernal_task" and "WindowServer" have been running high on CPU when these problems have occurred.
    Does anyone know what might be the issue and how it could possibly be resolved?
    Really appreciate any help, I'm in the middle of a fairly sizeable project and the deadlines are just around the corner.
    Thanks,
    Tom

    There is excessive swapping of data between physical memory and virtual memory. That can happen for two reasons:
    You have a long-running process with a memory leak (i.e., a bug), or
    You don't have enough memory installed for your usage pattern.
    Tracking down a memory leak can be difficult, and it may come down to a process of elimination.
    When you notice the swap activity, open the Activity Monitor application and select All Processes from the menu in the toolbar, if not already selected. Click the heading of the Real Mem column in the process table twice to sort the table with the highest value at the top. If you don't see that column, select
    View ▹ Columns ▹ Real Memory
    from the menu bar.
    If one process (excluding "kernel_task") is using much more memory than all the others, that could be an indication of a leak. A better indication would be a process that continually grabs more and more real memory over time without ever releasing it. Here is an example of how it's done.
    The process named "Safari Web Content" renders web pages for Safari and other applications. It uses a lot of memory and may leak if certain Safari extensions or third-party web plugins are installed. Consider it a prime suspect.
    If you don't have an obvious memory leak, your options are to install more memory (if possible) or to run fewer programs simultaneously.
    The next suggestion is only for users familiar with the shell. For a more precise, but potentially misleading, test, run the following command: 
    sudo leaks -nocontext -nostacks process | grep total
    where process is the name of a process you suspect of leaking memory. Almost every process will leak some memory; the question is how much, and especially how much the leak increases with time. I can’t be more specific. See the leaks(1) man page and the Apple developer documentation for details.

  • BT Cloud - Uploading Files - Problem

    I just wish to upload and share files using BT Cloud but cannot figure out how it works - which is surprising as I've been in the IT industry for more years than I care to remember - so I don't know how non IT professionals think of it all. I have watched the video on Youtube - it shows an add files button to click and add files. I am not seeing such a button on the screen in front of me - only an "Add to BT Cloud Sync". Can you please advise. If BT Cloud is purely designed for back-up purposes it is not what I am looking for,

    Ken2310 wrote:
    Yes I understand all that Ribblelancs.  Thanks for the reply though, see me other response.  
    The sharing by email appears to work, using Outlook as a client. I receive similar mails from web mail users overseas which provide links to a website (not BT), showing family photos, videos etc.
    However, I would not use BT Cloud to link to masses of files: it's a matter of personal choice.
    There may be a security problem if you try to send links to exe files.
    Note that the link as sent is https, which the recipient could add to browser favourites.
    Re BT Cloud Help / Instructions.
    It may be that the links to Help are outdated when accessed from within the application. If you go to Help from within the BT Help pages, the results refer to the latest version of BT Cloud.

  • Webutil upload file problem

    I use webutil_file_transfer.Client_To_AS_With_Progress(
    c:\temp\mytxt.txt,
    '\\192.234.43.233\d$\myFolder'
    ,'Upload to Application Server in progress'
    ,'Please wait'
    ,false
    ,null);
    but I can't upload the file it always returns boolean false

    Since you are uploading to the server, the Forms user account must have privileges to write files on the server. This is the most common cause of a failed upload. Double-check with your system admins and make sure the Forms user account has sufficient privs.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Itunes Producer Problems Uploading - File not saving - file does not Exist.

    Can someone please help me out, this problem is killing me. I've uploaded over 200 UPC Albums using Old G3 and Elderly ITunes Producer, but apple asked me to upgrade, so new machine to me Macmini maverics 10.9.? ITunes Producer 3.1.
    So I click open ITunes producer 3.1. Click on make project from Audio
    Files. Name and Save the project in Music-ITunes Producer-Playlists.
    Plug in my external Flash drive and import the 40 Audio files for the
    project. I am using an external flash drive as I can’t get ITunes Producer to
    see my internal hard disk, I do not know if this is normal??
    Go through the process of saving the project to Music – ITunes Producer –
    Playlists – in this case 5060101121313
    I then go through name all Tracks and make sure that all Data is correct.
    Then when I finally go to either save the document or send it to you I get the
    first Screen shot saying
    "The Document "5060101121313" COULD NOT BE SAVED. The File does not exist".
    As I say I have delivered 200 UPC’s to you with the old software and never
    had any problems, I am in urgent need of making significant delivery to you so
    would appreciate you help ASAP.
    Paul

    I have been victorious. Now I am going to post my solution for all those that may have the same problem in the future. I'll even throw in a few key words so it will be more easily found by the search engine.
    Connection conn = null;
            try{
                //connect to database
                DAOManager dao = new DAOManager();
                conn = dao.connectToDB();
                String query = "update ASSIGNMENT set file_object = ?, filename = ?, filetype = ? where a_key = 1"; //sql query
                PreparedStatement pstmt = conn.prepareStatement(query);
                ByteArrayOutputStream baostream = new ByteArrayOutputStream();
                //write to output stream
                byte[] buffer = new byte[1024];
                int len = -1;
                while ((len = instream.read(buffer)) >= 0 )
                    baostream.write(buffer, 0, len);
                baostream.flush();
                byte[] filebytes = baostream.toByteArray();
                baostream.close();
                pstmt.setBytes(1,filebytes); //set blob
                pstmt.setString(2,filename);
                pstmt.setString(3,filetype);
                pstmt.executeUpdate();
                pstmt.close();
            catch (SQLException e) {
                System.out.println(Tools.getLoggingDate() + " upload() Error uploading file -- " + e);
                e.printStackTrace();
            catch (Exception e) {
                System.out.println(Tools.getLoggingDate() + " upload() Error: " + e);
            finally {
                try{
                    conn.close();
                }catch (SQLException e) {}
            }Keywords: setBinaryStream(), setBytes(), MySQL, upload file, InputStream, Blob

  • Problem with uploading files to SharePoint 2013 in cloud using web services. Keep getting error message and don't know why.

    Hello everyone. I am having trouble writing a utility that uses SharePoint web services to upload a file and metatag it. It keeps throwing the following error message:
    "The request failed with the error message: -- <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="/_forms/default.aspx?ReturnUrl=%2fsites%2fgk%2f_vti_bin%2fcopy.asmx">here</a>.</h2>
    </body></html> --."
    Not sure why. I pass the file that I am going to upload to the subroutine and it is suppose to upload it to the appropriate library. I have burned several days on this problem and I am not sure what is going on. I would appreciate anyone that can point me in
    the right direction. Below is the subroutine that I have that is causing the problem. Obviously, I have stripped the name from the example.
    Thanks
    Mike
    ******** <Begin snip of code> **********************
    Public Shared Sub CreateNewDocumentWithCopyService(ByVal fileName As String)
    Dim c As New copyservice.Copy
    c.PreAuthenticate = True
    c.Credentials = New System.Net.NetworkCredential("[email protected]", "mypassword")
    c.Url = "https://x.sharepoint.com/sites/gk/_vti_bin/copy.asmx"
    Dim myBinary As Byte() = System.IO.File.ReadAllBytes(fileName)
    Dim destination As String = "https://x.sharepoint.com/sites/gk/Gatekeeper%20Reference/" & System.IO.Path.GetFileName(fileName)
    Dim destinationUrl As String() = {destination}
    Dim info1 As New copyservice.FieldInformation
    info1.DisplayName = "Title"
    info1.InternalName = "Title"
    info1.Type = copyservice.FieldType.Text
    info1.Value = "new title"
    Dim info2 As New copyservice.FieldInformation
    info2.DisplayName = "Modified By"
    info2.InternalName = "Editor"
    info2.Type = copyservice.FieldType.User
    info2.Value = "-1;#servername\\testmoss"
    Dim info As copyservice.FieldInformation() = {info1, info2}
    Dim resultTest As New copyservice.CopyResult
    Dim result As copyservice.CopyResult() = {resultTest}
    Try
    ' When creating new content use the same URL in the SourceURI as in the Destination URL argument
    c.CopyIntoItems(destination, destinationUrl, info, myBinary, result)
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    ******** <End snip of code> **********************

    Hi,
    If you want to upload a file to a library in SharePoint 2013 online, I suggest you use Client Object Model or REST API.
    The code snippets in the two threads below will be helpful:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/deac7cb7-c677-47b0-acdc-c56b32dfaac8/uploading-bigger-files-using-csom
    http://stackoverflow.com/questions/17057074/how-to-download-upload-files-from-to-sharepoint-2013-using-csom
    Uploading Files Using the REST API
    http://blogs.msdn.com/b/uksharepoint/archive/2013/04/20/uploading-files-using-the-rest-api-and-client-side-techniques.aspx
    You can handle the authentication with
    SharePointOnlineCredentials object:
    http://www.vrdmn.com/2013/01/authenticating-net-client-object-model.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • After choosing a jpg for upload, the "Upload File" button on the organization's receiving site of does not respond. The second problem: it's impossible to highlight more that one file at a time.

    Clicking the first file, holding down shift and clicking the last file doesn't work. I've tried all manner of command, control, shift combos without success.  This one-at-a-time attachment problem also happens in web mail.  Are these two issues related?  Thanks for non-techie solutions for both issues.  I have Safari 5.0.6 (5533.22.3) and Leopard.

    Thanks for your response.  I do have javascript turned on (not java).  To answer your question,
    I was trying to upload 3 jpgs to the submissions page of a visual arts website. I could only highlight one jpg at a time in the "Choose File" option, and then the "Upload File" button of the submissions page would not respond.
    It's an ongoing problem with this site (I'm the only one with this issue and there are a lot of submissions). I have to send the images as email attachements to the administrator of the site.  When doing this via webmail, I still the one attachment at a time problem, but the images get to the administrator.  Thanks for helping.

Maybe you are looking for

  • Wi-fi connection failed

    Unable to connect Apple TV to wireless network even though all other devices work and network name and password verified.

  • Apple VS Dell Monitors...

    Dell is producing external monitors with a built-in camera. Has anyone used one of these monitors? Does it work on a Mac system? Since Apple doesn't produce either a monitor with a built-in camera, or iSight camera any more, does anyone think that Ap

  • Extend campaign for Contract data

    Hi Experts, Campaign screen already have assignment block for 'Purchase Goods / Services'. Requirement is to Add two custom fields Contract ID, Contract line item# to this list.  after input of two fields, on pressing <Enter> call should go to ERP to

  • Problems RFC- XI

    Hi. When i try to call a RFC function in an R3 backend, i'm getting this message : 'HTTP response contains status code 401 with the description Unauthorized XML element Envelope missing in SOAP message header (SAP XI Extension)' What's happening?

  • TS3276 After my update to OSX 10.6.8 my mail app will not open anymore. What can I do? I need it for work!!!!

    After my update to OSX 10.6.6 today I am not able to open my mail application anymore. I can't check my emails and I need to work on Monday! Who can help me please? I tried downloading the SecUpd2012-004.dmg and installed it with mail being in the ap