How can I delete a file from an ftp server using a java program? I am successfully able to upload files on the ftp using the following code:
public static void m
The FTP command to remove a file is RMD, I think you could use:
RMD
String s = "ftp://username:password@ftpclient:21/text.txt;type=i"; URL u = new URL(s); URLConnection uc = u.openConnection(); PrintStream ps = new PrintStream((uc.getOutputStream())); ps.println("RMD " + .getPath()); ps.close();