FTPからファイルをダウンロードするために次のコードを使用しています。
NetworkCredential credential = new NetworkCredential(Properties.Settings.Default.FTPUserName, Properties.Settings.Default.FTPPassword);
string inputfilepath = Path.Combine(Properties.Settings.Default.LocalDownloadFolder, file);
string ftpfullpath = Properties.Settings.Default.FTPSite + Properties.Settings.Default.FTPFolder + file;
WebClient request1 = new WebClient();
request1.Credentials = credential;
request1.DownloadFile(ftpfullpath, inputfilepath);
最初の2つの変数の値は次のとおりです。
E:\FTPDownloads\CardholderManagementReport_1030_2012-12-11.xls
ftp://abc.com/AKSHAY/CardholderManagementReport_1030_2012-12-11.xls
次のようにエラーが表示されます:
The remote server returned an error: (550) File unavailable (e.g., file not found, no access).
編集:ファイルが実際にそこに存在し、資格情報に問題がなく、FileZillaを使用してダウンロードできることがわかります