I need to download some files via ftp from an old AS / 400 server. My code looks something like this:
FtpWebRequest _request = (FtpWebRequest)WebRequest.Create("ftp://ftpaddress/FOO.CSV"); _request.Credentials = new NetworkCredential(_ftpUsername, _ftpPassword); _request.Method = WebRequestMethods.Ftp.DownloadFile; FtpWebResponse response = (FtpWebResponse)_request.GetResponse();
However, an exception is thrown with the message:
501 Character (/) not allowed in object name.
I assume that AS400 uses a different path separator than /, but I canβt figure out how to correctly calculate uri (1) accepts FtpWebRequest and (2) understands AS400.
Has anyone else come across this?
source share