Thanks John,
You are correct I should have provided the link (
https://en.wikipedia.org/wiki/List_of_FTP_server_return_codes)
It was actually one you provided :-)
As I mentioned in a previous response I had never seen a FTP response with
a dash Eg 226- I had always seen a blank after the code.
For this application I think checking for 226 in the first 3 characters
will be more reliable than checking for specific completion strings like
"226-The file transfer completed successfully"
Appreciate you reply and I have filed you RFC link for future reading!
Cheers
Don
From: "John Yeung" <gallium.arsenide@xxxxxxxxx>
To: "Midrange Systems Technical Discussion"
<midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: "Don Brown" <DBrown@xxxxxxxxxx>
Date: 21/09/2023 09:42 PM
Subject: Re: FTP Successful completion
On Thu, Sep 21, 2023 at 5:21 AM Don Brown via MIDRANGE-L
<midrange-l@xxxxxxxxxxxxxxxxxx> wrote:
The web pages I have looked at for ftp completion codes shows
226
Closing data connection. Requested file action successful (for example,
file transfer or file abort).
I think it's useful to provide actual links to what you looked at, so
others may benefit. Of the many reputable places to find that
information, I like the presentation here:
https://urldefense.proofpoint.com/v2/url?u=https-3A__en.wikipedia.org_wiki_List-5Fof-5FFTP-5Fserver-5Freturn-5Fcodes&d=DwIFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=x3rBwxMTlO3UcnVchBJYlkqPD8BpO91HbuZYQ_ZepUs&m=i9lNjWzLYztmuChGNLGWCgsFc4jp4-9C2MWj5T4TE6cegifKo5xWe4v4YBPrMDOS&s=ilyT6m2OBFTyB_wFRXbPRhvtUX7tqoQuw9biZx4eVYM&e=
For Wikipedia haters/doubters, you can also look for "more official"
reproductions of RFC 959, such as
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.w3.org_Protocols_rfc959_&d=DwIFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=x3rBwxMTlO3UcnVchBJYlkqPD8BpO91HbuZYQ_ZepUs&m=i9lNjWzLYztmuChGNLGWCgsFc4jp4-9C2MWj5T4TE6cegifKo5xWe4v4YBPrMDOS&s=eEHK6PqiFVvTVUo9ZRGuT-KxAJFyNat-xjMuzEhhZsk&e=
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.freesoft.org_CIE_RFC_959_index.htm&d=DwIFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=x3rBwxMTlO3UcnVchBJYlkqPD8BpO91HbuZYQ_ZepUs&m=i9lNjWzLYztmuChGNLGWCgsFc4jp4-9C2MWj5T4TE6cegifKo5xWe4v4YBPrMDOS&s=9hizk3p6vbWI7BKx6zu4lsKTyBJUi35AFAkc-1sywTQ&e=
The relevant section is 4.2.
So my question ...
Is checking the first 3 characters for 226 sufficient to indicate the
file
transfer was successful and processing of the retrieved data should
continue.
If you are sure you are reading an FTP response message, then yes.
I could imagine unlikely scenarios where there happens to be a 226 in
the first 3 characters but it's not an FTP response code. So you could
try reading the first 4, and making sure the 4th one isn't a digit.
The "best" solution would depend on how careful or specific you want
to be, and the FTP server(s) connected to.
John Y.
--
This email has been scanned for computer viruses. Although MSD has taken reasonable precautions to ensure no viruses are present in this email, MSD cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
As an Amazon Associate we earn from qualifying purchases.