Jspupload directory

All others add-ons (Secure FTP, SCP, Flickr, scripts ...).

Jspupload directory

Postby markdm » Wed Jun 10, 2009 2:43 pm

The readme-file says:
Edit process.jsp from jspupload/ and setup "directory" and "tmpdirectory"
variables with the correct path:
<% String directory = "c:/uploads"; %>
<% String tmpdirectory = "c:/uploads/tmp"; %>
"directory" is the folder where uploaded files will be stored.


Questions:
- is it the directory on the web-server. I suppose I don't have access the c: disk !
- I tried a relative path: /uploads. I get a crashdump on http://yourserver.com/jspupload/process.jsp (replaced yourserver with mydomain)
Start of dump:
org.apache.jasper.JasperException: /process.jsp(12,0) The value for the useBean class attribute jfileupload.jspupload.FileUploadBean is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
...

Can I get some more info on the "Directory" setting ?
Regards,
Mark
markdm
 
Posts: 1
Joined: Wed Jun 10, 2009 2:33 pm

Re: JSPUpload directory - getRealPath

Postby support » Wed Jun 10, 2009 7:25 pm

Yes, it's the full path to upload folder on your server.
If you don't know how to get it then you can modify the script to use relative path to your web application. To do so, replace:

Code: Select all
<% String directory = "c:/tmp/uploads"; %>
<% String tmpdirectory = "c:/tmp/uploads/tmp"; %>


by:

Code: Select all
<%
   String rootpath = application.getRealPath("/");
   rootpath = rootpath.replace('\\','/');
   if (!rootpath.endsWith("/")) rootpath = rootpath + "/";
%>
<% String directory = rootpath + "uploads"; %>
<% String tmpdirectory = rootpath + "uploads/tmp"; %>


Does it help ?
User avatar
support
 
Posts: 1501
Joined: Sun Jan 27, 2008 6:19 pm


Return to Others



cron

Sitemap | Privacy Statement | Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
in the U.S. and other countries. All other company and/or product names are the property of their respective owners.