Found the problem...
Add
reqFTP.UsePassi ve = 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...
User Profile
Collapse
-
Well Ill explain the situation bit more...
I have 2 ftp sites 1 local on my office network and the other is not on my office network.
I have this other application in VB which uploads the file onto the server outside my office and it runs fine.
When I use this code to upload a file onto the server within the office it runs fine but when I try to run it for the server outside tht error pops up.
...Leave a comment:
-
Thanks for all your help.
But the problem here is that - when it reaches
Stream strm = reqFTP.GetReque stStream();
The error pops up
Message = "The remote server returned an error: (500) Syntax error, command unrecognized."
Could this be because of some firewall?...Leave a comment:
-
Cannot use this function as there is no file on the server and I cant create one manually....Leave a comment:
-
Well most of the forums I tried used the GetRequestStrea m()
also the explanation to it is - Retreives the stream used to upload data to an FTP server....Leave a comment:
-
Problems with FtpWebRequest.GetRequestStream() - C#
Hello,
I am trying to upload a file to a ftp site.
I have my code pasted below.
Code:FtpWebRequest reqFTP; reqFTP = (FtpWebRequest)FtpWebRequest.CreateDefault(new Uri(@"ftp://<IPAddress>/<FolderName>/" + fileInf.Name)); reqFTP.Credentials = new NetworkCredential(@"username", "password"); reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
No activity results to display
Show More
Leave a comment: