FTP from the IFS

Tags:
AS/400
FTP
IFS
I have an XML file successfully created and have used CPYTOIMPF to translate it to ASCII and put it on the IFS. What I need to do, though, is FTP the file to an internally defined FTP server that requires a userid and password.
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Gigi,

If you are doing this manually, use ftp on the IBM i.  Type ftp on the command line and press enter.  It will prompt you for system address.  IP address or url are both acceptable.  Once connected, use the put command.  put \ifs directory\file destination directory\file.  If you plan to automate the process, you will need to create a source member that contains the script for the ftp process.

See below

userid password

sendepasv 0

put \ifsdirectory\filename \destination directory\filename

quit

The script will be used by a CL that runs ftp.  The CL will need the following:

ovrdbf file(input) tofile(qtxtsrc) mbr(ftpscript)


ovrdbf file(output) tofile(qtxtsrc) mbr(errlog)


ftp rmtsys(systemname)

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    What is the problem with FTP? This seems like the most common use of FTP by far. Is the problem in knowing how to specify 'from' and 'to' files? Is it in how to authenticate? How to connect? If we know what the problem is, it'll be easier to answer.

    Other than that, why use CPYTOIMPF to copy XML to a streamfile? It doesn't seem appropriate. The CPYTOSTMF command would seem to fit better. For FTP, the resulting streamfile is in a form that is more natural and should be easier than whatever the XML came from. (Maybe a better question would be why the XML needed to be copied at all. Why wouldn't it be created in a streamfile to begin with?)

    Once some basics of handling IFS formats are learned, a lot of things get easier. (All "files" are already in the IFS. Even database files.)
    36,320 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: