Tagged: ftp

completePendingCommand of Commons-Net


When I tried like this,

try(OutputStream fileStream = ftpClient.storeFileStream(remote)) {
    // do some
    final boolean commandCompleted
        = ftpClient.completePendingCommand();
    // check the result
}

I found that completePendingCommand() hangs.
The method apparently have to be invoked after the stream is closed.

try(OutputStream fileStream = ftpClient.storeFileStream(remote)) {
    // do some
}
final boolean commandCompleted
    = ftpClient.completePendingCommand();
// check the result
Advertisements

vsftpd with virtual users and htpasswd


I followed some great links. But couldn’t help but spend few hours for htpasswd problem.
http://www.ubuntututorials.net/installing-vsftpd-using-text-file-for-virtual-users/
http://howto.gumph.org/content/setup-virtual-users-and-directories-in-vsftpd/

With my Ubuntu 11.10 box, I ought to use -d option with htpasswd otherwise you’ll get 503 error.

$ sudo htpasswod -d /path/to/file <username>