<font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif">I'm trying to use CmsNewResourceUpload
to upload files to opencms. It uploads the file successfully but however
not in the specified folder. All i want is to give users choice to select
files from there desktop and upload it to OpenCMS. I need help to
save it to specified folder, currently it saves it into root directory
i.e. where the uploadfile.jsp page resides. </font>
<br><font size=2 face="sans-serif"> My code.</font>
<br>
<br><font size=2 face="sans-serif"><%@ page import="org.opencms.workplace.explorer.*"
%></font>
<br><font size=2 face="sans-serif"><%@ page import="org.opencms.jsp.CmsJspActionElement"
%></font>
<br><font size=2 face="sans-serif"><%@ page import="javax.servlet.http.*"
%></font>
<br>
<br><font size=2 face="sans-serif"> <%</font>
<br><font size=2 face="sans-serif"> CmsJspActionElement cms = new
CmsJspActionElement(pageContext, request,response);</font>
<br><font size=2 face="sans-serif"> CmsNewResourceUpload upload =
new CmsNewResourceUpload(cms);</font>
<br><font size=2 face="sans-serif"> String str=request.getParameter("file");</font>
<br><font size=2 face="sans-serif"> upload.setParamUploadFile (str)
;</font>
<br>
<br><font size=2 face="sans-serif"> out.println("<html>");</font>
<br><font size=2 face="sans-serif"> out.println("<head>");</font>
<br><font size=2 face="sans-serif"> out.println("<title>Servlet
upload</title>"); </font>
<br><font size=2 face="sans-serif"> out.println("</head>");</font>
<br><font size=2 face="sans-serif"> out.println("<body>");</font>
<br><font size=2 face="sans-serif"> out.println("<p>UpLoadFile"+upload.getParamUploadFile()+"</p>");</font>
<br>
<br><font size=2 face="sans-serif"> upload.setParamUploadFolder("/system/modules/my.first.template/resources/data/");</font>
<br><font size=2 face="sans-serif"> upload.setParamUploadError("Error
while Uploading") ;</font>
<br><font size=2 face="sans-serif"> upload.setParamUnzipFile("false")
;</font>
<br>
<br><font size=2 face="sans-serif"> String str1=upload.getParamUploadFolder()
;</font>
<br>
<br><font size=2 face="sans-serif"> out.println("<p>"+str1+"</p>");
</font>
<br><font size=2 face="sans-serif"> upload.actionUpload () ;</font>
<br><font size=2 face="sans-serif"> out.println("</body>");</font>
<br><font size=2 face="sans-serif"> out.println("</html>");</font>
<br><font size=2 face="sans-serif"> %></font>