I'm preparing automated tests. Firstly I try to upload file into my FTP. I prepared following methods.
public void uploadFTPFile(String localFileName, String fileName, String hostDir) throws Exception {
try {
InputStream input = new FileInputStream(new File(localFileName));
this.ftp.storeFile(hostDir + fileName, input);
}
catch (IOException e) {
}
}
public static void main(String[] args) throws IOException {
try {
FTPFunctions ftpobj = new FTPFunctions("host", 21, "username", "password");
ftpobj.uploadFTPFile("D:\\all\\test\\test\\test_files\\", "file1.csv", "/test/");
boolean result = ftpobj.FTPFilesList("/dpd", "file1.csv");
//System.out.println(result);
ftpobj.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
After execute I received logs. Connection to ftp is working.
FTP ULR is: 21
USER user
331 Please specify the password.
PASS xxxx
230 Login successful.
TYPE L
500 Unrecognised TYPE command.
java.io.FileNotFoundException: D:\\all\\test\\test\\test_files\\ (access denied)
This is a problem with access to this path? I checked security bookmark in this path and all permissions are enabled. Maybe some permissions are enabled on the FTP side? Can someone help me to fix this issue?
Aucun commentaire:
Enregistrer un commentaire