Few weeks ago, I set a ftp server in aws windows. And when I tried to download files in ftp server using WebRequestMethods.Ftp.DownloadFile; , it didnt work. But when I tried to get file list from ftp server using WebRequestMethods.Ftp.ListDirectory, it did work! I tried to download files with passive mode, so I thought if there would be something wrong in passive mode, so I used filezilla to connect ftp server with passive mode. and it did work well. I could see file list and upload/download files in ftp server. so Im thinking passive mode is working well at least and it might not be the problem.
And this is the error message that I got when I try to download files from ftp server
System.Net.WebException: Server returned an error: 501 Invalid number of parameters.
It always is this message.
and this is the part of code that I wrote for ftp download connection.
FtpWebRequest requestFTPUploder = (FtpWebRequest)WebRequest.Create(FTP_Address);
requestFTPUploder.UsePassive = true;
requestFTPUploder.Method = WebRequestMethods.Ftp.DownloadFile;
requestFTPUploder.Credentials = new NetworkCredential(User_Name, Password);
The 'FTP_Address' is ip v4 address for connection. I didnt set DNS for my ftp server and it works well for getting list(WebrequestMethods.Ftp.ListDirectory) I added ':20' and ':21' for selection for specific port numbers. And it also worked well for getting file list. Please help. Ive been struggling for this for weeks.
**if i wrote something wrong, sorry for that. This is my first time to actually write something in stackoverflow. Ive always read other people's questions.