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

Re: trouble after upgrading FTPAPI



Sender: jg_xue@xxxxxxxxxxxx



Thanks Scott!

It works.

Now I encounter another small problem.

When I run my FTP commands script, NAMEFMT 1 works for me, however, It does
not work in a RPGLE program.
Ftp Log shows:
230 User logged in, proceed.
> namefmt 1
500 'NAMEFMT': command not understood.
> CWD inbox
250 Directory changed to /e:/EDI/inbox


Regards,
Xue Jiguang


                                                                                                                                    
                      Ji Guang Xue                                                                                                  
                                               To:      ftpapi@xxxxxxxxxxxxx                                                        
                      05/18/2005 12:05         cc:                                                                                  
                      PM                       Subject: Re: trouble after upgrading FTPAPI(Document link: Ji Guang Xue)             
                                                                                                                                    
                                                                                                                                    



Thanks!

I will test your code out.

My FTP Log likes:

Connecting to host INTRA at address 10.1.1.33 using port 8021.
220- intra2 PROXY-FTP server (DeleGate/7.7.1) ready.
220-   @ @
220-  ( - ) { DeleGate/7.7.1 (November 28, 2001) }
220- AIST Research Product No. 2000-ETL-198715-01
220- Copyright (c) 1994-2000 Yutaka Sato and ETL,AIST,MITI
220- Copyright (c) 2001 National Institute of Advanced Industrial Scien
 and Technology (AIST)
220- WWW: http://www.delegate.org/delegate/
220- --
220- You can connect to a SERVER by `user' command:
220-    ftp> user username@xxxxxx
220- or by `cd' command (after logged in as an anonymous user):

220-    ftp> cd //SERVER
220- Cache is enabled by default and can be disabled by `cd .' (toggl
220- This (proxy) service is maintained by 'admin@xxxxx'
220

331  Proxy  Password required for user.
530  Proxy  Login failed.
user as400  as400
331  Proxy  Password required for as400.
230- Proxy  User as400 logged in.
230 Now you can login a target FTP server with USER user@xxxx
SYST command is not supported.
user user@xxxxxxxxxx
331-- USER for canonhk@xxxxxxxxxxx
220- Serv-U FTP-Server v2.5f for WinSock ready...
331- User name okay, need password.
331--  @ @
331  \( - )/ -- { connected to `remotehost' }
230 User logged in, proceed.
UNIX Type: L8

Regards,
Xue Jiguang


                                                                                                                                    
                      Scott Klement                                                                                                 
                      <sk@xxxxxxxxxxxxx        To:       ftpapi@xxxxxxxxxxxxx                                                       
                      com>                     cc:                                                                                  
                      Sent by:                 Subject:  Re: trouble after upgrading FTPAPI                                         
                      owner-ftpapi@xxxx                                                                                             
                      e.ods.net                                                                                                     
                                                                                                                                    
                                                                                                                                    
                      05/18/2005 11:51                                                                                              
                      AM                                                                                                            
                      Please respond to                                                                                             
                      ftpapi                                                                                                        
                                                                                                                                    
                                                                                                                                    




Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


> OPEN myintra port
> USER as400 as400
> USER user@xxxxxxxxxx password
> USER serveruser serverpass
> APPEND libname/filename.mbrname file.txt
> CLOSE

You have to send 3 separate USER statements to login to the server?  I
haven't seen a setup like that before.  Since FTP_login() also checks for
the start of session message from the server, you can't really use it
except immediately after connecting.

Instead, you'll have to use the FTP_quote() API to manually send the
remaining userids and passwords after you've made the initial connection.
The following code is untested, but should illustrate the process:

     //----------------------------------------------
     // login to intranet proxy, first
     //----------------------------------------------

     x = FTP_conn('myintra': 'as400': 'as400': port);
     if (x < 0);
        errormsg = FTP_error();
        // display errormsg to user and exit.
     endif;

     //----------------------------------------------
     // now tell the proxy how to connect to the
     // server
     //----------------------------------------------

     rc = FTP_quote(x: 'USER user@xxxxxxxxxx');
     if (rc<>331);
        errormsg = FTP_error();
        FTP_quit(x);
        // display errormsg to user and exit.
     endif;

     rc = FTP_quote(x: 'PASS password');
     if (rc<>230 and rc<>202);
        errormsg = FTP_error();
        FTP_quit(x);
        // display errormsg to user and exit.
     endif;

     //----------------------------------------------
     // finally, tell it the server our userid and
     //  password
     //----------------------------------------------

     rc = FTP_quote(x: 'USER serveruser');
     if (rc<>331);
        errormsg = FTP_error();
        FTP_quit(x);
        // display errormsg to user and exit.
     endif;

     rc = FTP_quote(x: 'PASS serverpass');
     if (rc<>230 and rc<>202);
        errormsg = FTP_error();
        FTP_quit(x);
        // display errormsg to user and exit.
     endif;

     //----------------------------------------------
     // append the file
     //----------------------------------------------

     if FTP_append(x: 'file.txt'
                  : '/QSYS.LIB/libname.LIB/filename.FILE/mbrname.MBR'
                  ) < 0;
        errormsg = FTP_error();
        FTP_quit(x);
        // display errormsg to user and exit.
     endif;

     //----------------------------------------------
     // quit
     //----------------------------------------------
     callp FTP_quit(x);

Hope that helps
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------






-----------------------------------------------------------------------
Important : This message is intended for the recipient(s) addressed
above. It contains privileged and confidential information.  If you
are not the intended recipient, kindly notify the sender immediately
 by replying to this message and then delete it from your system.
You must not read,  copy,  use,  disseminate,  disclose,  retain or
reproduce all or any part of the information or any attachments
from this communication in any form. Thank you.

Disclaimer  : Email communications are not secure.  While we have
taken every  reasonable effort  to ensure that this  communication
has not been tampered with,  Canon is not responsible for any changes
made to the contents of or any attachments to this message without its
consent.  If you wish to receive a hard copy of this  message to verify
the accuracy of the contents thereof, please contact the sender. Note
that only views,  opinions or such other  information contained in this
message that relate to the official business of Canon is to be taken to
have been sent by  and on behalf of Canon.  All opinions,  conclusions
and other  information  expressed in  this message  not of an official
nature  shall  not be  deemed  as  given  or  endorsed  by  Canon unless
otherwise indicated by an authorized  representative  independent of
this message.



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------