You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Saldy Mathew <sm...@webifyservices.com> on 2003/08/06 18:04:52 UTC

Error while uploading a file to a specified location.

Hi!

While trying to upload a file to a desired location i get the following error.

this is how i am using the write method
file.write(new File(getRequestCycle().getRequestContext().getServlet().getServletContext().getRealPath("/")+"temp\\"+file.getFileName()));

      org.apache.tapestry.ApplicationRuntimeException 
      Error writing uploaded content to C:\jboss\jboss-3.0.6\server\default\deploy\webifyconsole.war\temp\InsureNet.dar: null 
         
      java.lang.NullPointerException 
     
      Stack Trace: 
        a.. org.apache.commons.fileupload.DefaultFileItem.write(DefaultFileItem.java:442) 
        b.. org.apache.tapestry.multipart.UploadPart.write(UploadPart.java:154) 
        c.. com.webify.console.wwwclient.pages.deployment.ApplicationInstallationPage.applicationInstallationForm(ApplicationInstallationPage.java:112) 
        d.. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        e.. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
        f.. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
        g.. java.lang.reflect.Method.invoke(Method.java:324) 
     


Re: Error while uploading a file to a specified location.

Posted by Saldy Mathew <sm...@webifyservices.com>.
Hi!
The problem i faced was because i had failed to create the directory where i
wanted the file to be uploaded.How stupid of me ;)
Saldy
----- Original Message -----
From: "Saldy Mathew" <sm...@webifyservices.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, August 06, 2003 9:34 PM
Subject: Error while uploading a file to a specified location.


Hi!

While trying to upload a file to a desired location i get the following
error.

this is how i am using the write method
file.write(new
File(getRequestCycle().getRequestContext().getServlet().getServletContext().
getRealPath("/")+"temp\\"+file.getFileName()));

      org.apache.tapestry.ApplicationRuntimeException
      Error writing uploaded content to
C:\jboss\jboss-3.0.6\server\default\deploy\webifyconsole.war\temp\InsureNet.
dar: null

      java.lang.NullPointerException

      Stack Trace:
        a..
org.apache.commons.fileupload.DefaultFileItem.write(DefaultFileItem.java:442
)
        b..
org.apache.tapestry.multipart.UploadPart.write(UploadPart.java:154)
        c..
com.webify.console.wwwclient.pages.deployment.ApplicationInstallationPage.ap
plicationInstallationForm(ApplicationInstallationPage.java:112)
        d.. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        e..
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
        f..
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
        g.. java.lang.reflect.Method.invoke(Method.java:324)