Hey guys I am trying to get my Java code to connect via FTP to my site, and upload a file. Not sure how this will work. This is what i have so far!
And i am catching the exception, so i am always getting File could not be written... Is there a way to "upload" or BufferedWriter the file on the server? Thanks!
Code:
String wsave = JOptionPane.showInputDialog(null, "File Saved! Would you like to upload it?");
if(wsave.equals("yes") || wsave.equals("y")) {
URL site = new URL("ftp://MYUSER:*******@ftp://69.68.181.132/Sites/txt/; type=i");
URLConnection conn = site.openConnection();
File output = new File("ftp://69.68.181.132/Sites/txt/");
Writer saveSite = new BufferedWriter(new FileWriter(output+input));
saveSite.write(text);
save.close();
conn = null;
}
}
And i am catching the exception, so i am always getting File could not be written... Is there a way to "upload" or BufferedWriter the file on the server? Thanks!