[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange Error - works in FTP client, but not FTPAPI



Hi Mike,

You are not using a command-line FTP. FTPAPI operates by calling 
procedures.  Therefore using command-line artifacts like quotes and 
supplying the password as a second argument doesn't make a lot of sense.

Please do something like this:

     xyz = ftp_open( 'yourgatewayaddress' );
     if (xyz = -1);
       // handle error
     endif;

     if ftp_login( xyz
                 : '7999999@xxxxxxxxxxxxxx 10259'
                 : 'PASSWORD' ) = -1;
        // handle error
     endif;

     ...etc...


On 7/20/2011 11:54 PM, Mike Wills wrote:
> I can run the sample script PubNet provides me (http://murl.me/1g2) on
> my OS X terminal and on the FTP command on the i just fine. When
> running it through the API it still asks me for a password after this
> line "ftp>  user "7999999@xxxxxxxxxxxxxx 10259" PASSWORD"
>
> Does the FTPAPI do something a bit different that might cause this problem?
>
> Here is the log from my program:
>
> 0:>  user "7999999@xxxxxxxxxxxxxx 10259" PASSWORD
> 0: 331-(----GATEWAY CONNECTED TO edi.pubnet.org----)
> 0: 331-(220 Enterprise FTP server (Version 1.0.0 Nov. 5, 1996))
> 0: 331 Password required for 7999999
> 0:>  PASSWORD
> 0: 530 Not logged in.
>
>
> My code:
>         rc = FTP_quote(fd:'user "7999999@xxxxxxxxxxxxxx 10245" PASSWORD');
>
>         if (rc<  0);
>           FTP_errorMsg(fd:ErrNum);
>           if (ErrNum = FTP_NOFILE);
>             num_files = 0;
>           else;
>             CompMsg(FTP_errorMsg(fd));
>             FTP_quit(fd);
>             return;
>           endif;
>         endif;
>
>         if (rc = 331);
>           rc = FTP_quote(fd:'PASSWORD');
>
>           if (rc<  0);
>             FTP_errorMsg(fd:ErrNum);
>             if (ErrNum = FTP_NOFILE);
>               num_files = 0;
>             else;
>               CompMsg(FTP_errorMsg(fd));
>               FTP_quit(fd);
>               return;
>             endif;
>           endif;
>         endif;
>
> Note: Not ACTUAL user/pass combination.
>
> --
> Mike Wills
> http://mikewills.me
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------