Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8.2k views
in Java FTP by (500 points)
Hello,

I use FTPClient. The connection to ftp works, but when i try to upload a file, i have a FTPException : access denied... I don't understand why the access is denied whereas i could connect !

This is my code (Test.java):
FTPClient.initSOCKS("1080","192.168.200.1");
FTPClient ftp = new FTPClient();
try {
   ftp.setRemoteHost("172.16.7.137");
   ftp.connect();
   if (ftp.connected()) {
      System.out.println("Connection succeeded"); 
      ftp.login("test", "test");
      System.out.println("Login succeeded");
      ftp.setDetectTransferMode(true);
      ftp.setConnectMode(FTPConnectMode.PASV);
      ftp.put("test_file","test_file");
   }
}
catch (Exception e) {
   e.printStackTrace();
}

Ad this is my stacktrace :
Connection succeeded
Login succeeded
com.enterprisedt.net.ftp.FTPException: Access is denied.
        at com.enterprisedt.net.ftp.FTPControlSocket.validateReply(FTPControlSocket.java:977)
        at com.enterprisedt.net.ftp.FTPClient.initPut(FTPClient.java:2263)
        at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2322)
        at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2065)
        at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2047)
        at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2025)
        at Test.main(Test.java:17)

So can you help me ?

3 Answers

0 votes
by (162k points)
It looks like you don't have write permissions.
0 votes
by (500 points)
It's not an implementing problem : filezilla receives the same error when i try to write... And it doesn't come from my server's setting, but from the proxy i think : when i'm connected to the tpf without proxy, i can write without problems !
So the thruth is elsewhere...
0 votes
by (162k points)
The error msg looks like it is coming from the server - although I suppose it might be the proxy inserting the message. Check your proxy settings.

Categories

...