aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Upload a file into Godaddy using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Upload a file into Godaddy using java" Watch "Upload a file into Godaddy using java" New topic
Author

Upload a file into Godaddy using java

vinoth Robert
Ranch Hand

Joined: Feb 02, 2011
Posts: 31

hi,

I have deployed my website in godaddy.com.
In that site I need to get a file from the client and I need to write that file content in my space on godaddy server itself.

when writing the file i got the error like this..

org.apache.jasper.JasperException: access denied (java.io.FilePermission /web/tomcat/temp/upload_4ab2f36b_12f67de0e13__7fff_00000021.tmp write)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.GeneratedMethodAccessor390.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:592)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:266)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)


root cause

java.security.AccessControlException: access denied (java.io.FilePermission /web/tomcat/temp/upload_4ab2f36b_12f67de0e13__7fff_00000021.tmp write)
java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
java.security.AccessController.checkPermission(AccessController.java:427)
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
java.io.FileOutputStream.<init>(FileOutputStream.java:169)
java.io.FileOutputStream.<init>(FileOutputStream.java:131)
org.apache.commons.io.output.DeferredFileOutputStream.thresholdReached(DeferredFileOutputStream.java:165)
org.apache.commons.io.output.ThresholdingOutputStream.checkThreshold(ThresholdingOutputStream.java:221)
org.apache.commons.io.output.ThresholdingOutputStream.write(ThresholdingOutputStream.java:127)
org.apache.commons.fileupload.util.Streams.copy(Streams.java:101)
org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:362)
org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
org.apache.jsp.created_jsp._jspService(created_jsp.java:158)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
sun.reflect.GeneratedMethodAccessor390.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:592)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:239)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:266)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:157)


this is my code



any solution please?
or any other way to upload the file using jsp?


vinoth.R
 
Don't get me started about those stupid light bulbs.
 
subject: Upload a file into Godaddy using java