Tuesday, October 4, 2011

(500) Errors while uploading the files to FTP using c#.

(500) Syntax error, command unrecognized.


FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftppath);request.UsePassive=
false;


UsePassive: Specifies whether to use either active or passive mode. Earlier, active FTP worked fine with all clients, but now, as most of the random ports are blocked by a firewall, the active mode may fail. 



The passive FTP is helpful in this case. But still, it causes issues at the server. 


The higher ports requested by client on server may also be blocked by a firewall. But, because FTP servers will need to make their servers accessible to the greatest number of clients, they will almost certainly need to support passive FTP. 


Passive mode is considered safe because it ensures all data flow initiation comes from inside (client) the network rather than from the outside (server).

No comments:

Post a Comment