Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.1k views
in Java FTP by (160 points)
I have the following ftp-connection:

   
FTPClient ftp = null;
    String host = "xxxxxxxx";
    String user = "xxxxxxx";
    String password = "xxxxxxx";
    try {          
       ftp = new FTPClient();
       ftp.setRemoteHost(host);
       ftp.connect();
       ftp.login(user, password);       
       ftp.mkdir("test");
       //ftp.put(pad, filenaam);
       ftp.quit();    
   } catch (Exception e) {
      Textbox.append("" + e);
   }
       

 }


It works fine, because the directory test is made.

Now i have three Image objects

private Image afbeeldingorig;
private Image afbeeldingklein;
private Image afbeeldingthumb;



How can I upload these objects on the ftp-server?

2 Answers

0 votes
by (162k points)
Easiest is if your images are in files somewhere.

Then you need to chdir("test") and then use put() to put the files into that directory.

If you only have Images you need to get them as an array of bytes and use put().
0 votes
by (160 points)
2 of them are only images, i/m going to find out a function to convert them to an array of bytes.

Thanks for the quick answer.

Categories

...