Hi
I keep getting this error when I do some ftp requests through my C# code using ftpWebRequest
System.Net.WebException was caught
Message="The remote server returned an error: (501) Syntax error in parameters or arguments."
Source="System"
StackTrace:
at System.Net.FtpWebRequest.SyncRequestCallback(Object obj)
at System.Net.FtpWebRequest.RequestCallback(Object obj)
at System.Net.CommandStream.InvokeRequestCallback(Object obj)
at System.Net.CommandStream.Abort(Exception e)
at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage)
at System.Net.FtpWebRequest.GetResponse()
at CMS.Controllers.CMSController.GrabWebPage(String webPath) in n:
The thing is though it only happens sometimes. If I do 20 requests I may only get this once and I don't understand why since what I am doing is I dynamically made the requests and I am just switching back and forth between them.
This is what I do
- Figure out the path to the file on the server
- Dynamically split the paths out onto a webpage..
- click on one of these paths and it sends the path to the server
- does an ftpWebRequest to find the file
- downloads the file and spit the contents onto the page through ajax.
So I have made 2 dynamic links like this on my webpage and I just switch back and forth between them and after X amount of times it I get this error. So I don't see how the syntax is wrong when it worked X amount of times and since I am sending the path through ajax it is not like the page is getting refreshed and it the paths being recreated it is the same path.
So what should I be looking for to try to figure out why I am getting this problem. What kind of syntax might make this error come up?