Web Server: Sun Java System Web Server 7 update 5
I have inherited a JSP application and am trying to get it to work. I have figured out that it has something to do with the <input type="file">
tag, because I cut all the rest of the code out.
<input type="file" name="file_upload" maxlength="150" size="20" />
<input type="submit" name="UploadFile" value="Upload File" class="btn" onclick="return validate()" />
On submit, I get the following error:
javax.servlet.jsp.JspTagException: The file could not be written: java.io.FileNotFoundException: C:\WebApps\gpr\uploads\attachments\5217\c\DocumentsandSettings\gzjs4n\MyDocuments\227342050034.xls (The system cannot find the path specified)
xephyrus.taglibs.fileupload.WriteTag.doEndTag(WriteTag.java:103)
org.apache.jsp.att.attach_jsp._jspService(Unknown Source)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:80)
javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:457)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:351)
javax.servlet.http.HttpServlet.service(HttpServlet.java:917)
com.cj.trim.trimFilter.doFilter(Unknown Source)
Notice how the error is referring to the file name as "C:\WebApps\gpr\uploads\attachments\5217\c\DocumentsandSettings\gzjs4n\MyDocuments\227342050034.xls". Basically, it is adding the whole (including path) name of the file instead of just taking the file name, which is "227342050034.xls". Since I have no other code creating this name, I do not know why this is happening.
Note: this could be a configuration problem, since I set up the Web Server myself and have not had any other experience doing this.