commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jurado, Benjamin - BLS CTR" <Jurado.Benja...@bls.gov>
Subject RE: FTP 150 Opening ASCII mode data connection for "file name"
Date Sat, 17 Dec 2005 15:26:05 GMT
Erick
I have recently started to work with commons-net...lets see if this is
of any use to you.
Your code looks something like this?


 InputStream in = null;
   
    try {
      File fileObj = new File(filename);
      
      in = new FileInputStream(fileObj);
      ftp.changeWorkingDirectory(this.remoteDir);
      ftp.storeFile(fileObj.getName(),in);
    
      if(FTPReply.isPositiveIntermediate(ftp.getReplyCode())){
        System.out.println("Intermediate Results do something");
      }
      if(FTPReply.isPositiveCompletion(ftp.getReplyCode())){
        System.out.println("positive Completion");
      }
      
      
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }finally{
      try {
        in.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
    } 
?
Ben
-----Original Message-----
From: Erick Dovale [mailto:edovale@carosys.com] 
Sent: Saturday, December 17, 2005 10:05 AM
To: Jakarta Commons Users List
Subject: Re: FTP 150 Opening ASCII mode data connection for "file name"


I am sorry I forgot some details.
The actual problem is that after calling storeFileStream I am calling 
FTPReply.isPositiveIntermediate(ftpClient.getReplyCode() and this 
function returns false when passed the 150 reply code.
If I ignore this call and try to continuo transmision it hangs. Hope
that helps

Erick Dovale wrote:

> Hello there folks,
> My apologies if this was previously asked. I was browsing in the
> archives and could not find it.
> I am trying to upload files to an ftp server using FTPClient from 
> commons-net-1.4.1. Every time I try i get error code 150 Opening ASCII

> mode data connection for <the file name of the file I am sending>.
> In the ftp folder the file gets created but with 0 bytes file size. I 
> have tried 2 different ftp servers and I get exactly the same in both 
> of them.
> I am positive this may be a very simple configuration issue; I just 
> can not nail it.
> Any hints???
>
> thanks in advance..
>
> erick.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message