i wants to move a file from one location to another location , Here is my code
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class upload extends HttpServlet
{
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
response.setContentType("text/html");
java.io.PrintWriter out = response.getWriter();
String path=request.getParameter("Jazz");
File f=new File(path);
String s=f.getAbsolutePath();
File file = new File(s);
// Destination directory
File dir = new File("D:\\moved");
// Move file to new directory
boolean success = file.renameTo(new File(dir, file.getName()));
if (!success) {
System.out.println("File is not moved");
}
}
}
Can you help me...