I usually work with PHP but need to setup this JSP with a server that I am interacting with. Here is the code I am trying:
<%
String filename = request.getParameter("file");
filename = "C:\Tomcat 5.5\webapps\myapp\\" + filename;
out.print(filename);
ActiveXObject theObject = new ActiveXObject("Scripting.FileSystemObject");
File theFile = new theObject.GetFile(filename);
theFile.Move("C:\Tomcat 5.5\webapps\myapp\processed\\");
%>
The goal is to send in a request to http://www.thewebsite.com/myfile.jsp?file=x.txt
and the JSP file should take x.txt
and move it to the processed
directory.
When I call this JSP file I get an error that says ActiveXObject cannot be resolved to a type
... so, I guess that I can't do it this way.
Is it possible to move a file using JSP?