commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Wallace" <pa...@isell.com.au>
Subject commons FTP upload
Date Thu, 02 Dec 2004 22:50:29 GMT
Hi,
 
    Using Filezilla and the Jakarta commons FTP classes, I can upload
files to my server using the Filezilla client (client and server on same
box), but when I upload using the commons classes, I get:
 
Canot find the directory for upload: testFile.txt (The system cannot
find the file specified)
java.io.FileNotFoundException: testFile.txt (The system cannot find the
file specified)    
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    ....
 
why would the download succeed: ftp.downloadFile("testFile.txt
<ftp://ftp.downloadFile("testFile.txt> ",
"c:\\downloads\\testFile.txt");
 
but the upload fail: ftp.uploadFile("testFile.txt
<ftp://ftp.uploadFile("testFile.txt> ",
"C:\\dev\\dummy\\testdir\\testFile.txt"); 
 
The error message complains the destination directory can not be found.
C:\\dev\\dummy\\ is set to be my 'home dir' on the Filezilla server. Has
anyone uploaded, using Commons FTP & Filezilla successfully please? I
tried all variations on the 'serverFile' argument, as the file is
clearly there because the download works. Perhaps this the cause? What
is a typical argument pattern? 
 
ftp is a wrapper class, with the method:
 
    public boolean uploadFile(String localFile, String serverFile)
throws IOException, FTPConnectionClosedException {
        FileInputStream in = new FileInputStream(localFile);
        boolean result = storeFile(serverFile, in);
        in.close();
        return result;
    }
 
thanks
 
Paul.
 
 
 
 
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message