Unable to download files

Mar 12, 2010 at 11:24 AM


I don't know what I'm doing wrong, but I can't download a single file from my ftp-directory. As I've said in the proxy thread, my connection is working, but I'm still not able to download anything. In my code is just a client.Connect() and client.GetFile("/remote/path", "d:\\test\\"). At the GetFile() method call he throws some weird exceptions that I am not allowed to access my local directory or that it doesn't exist. The directory has access rights for everyone so that shouldn't  be the problem. I'm open to suggestions.


Thanks a lot!







Mar 12, 2010 at 11:27 AM


Could you please post a copy of that "weird exception"? :-)



Alessandro Pilotti [ MVP / IIS ]


Mar 12, 2010 at 11:52 AM

Here is a summary of the exception messages. Some of them are re-translated from German

-        Thrown: "Transfer aborted. Data connection closed." (AlexPilotti.FTPS.Common.FTPCommandException)   Exception Message = "Transfer aborted. Data connection closed.", Exception Type = "AlexPilotti.FTPS.Common.FTPCommandException"    

+        Thrown: "Could not find a part of the path  C:\test\" (System.IO.DirectoryNotFoundException)    Exception Message = "Could not find a part of the path C:\\test\\ ", Exception Type = "System.IO.DirectoryNotFoundException"    

+        Thrown: "Value Cannot Be Null" (System.ArgumentNullException)    Exception Message = "Value Cannot Be Null", Exception Type = "System.ArgumentNullException"    

Message    "Value Cannot Be Null\r\nParametername: input"    string

+        TargetSite    {System.Text.RegularExpressions.Match Match(System.String)}    System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

        StackTrace    "   bei System.Text.RegularExpressions.Regex.Match(String input)\r\n   bei System.Text.RegularExpressions.Regex.Match(String input, String pattern)\r\n   bei AlexPilotti.FTPS.Client.FTPSClient.GetReply()\r\n   bei AlexPilotti.FTPS.Client.FTPSClient.<EndStreamCommand>b__1()\r\n   bei AlexPilotti.FTPS.Common.FTPStream.Close()\r\n   bei System.IO.Stream.Dispose()\r\n   bei AlexPilotti.FTPS.Client.FTPSClient.GetFile(String remoteFileName, String localFileName, FileTransferCallback transferCallback)\r\n   bei AlexPilotti.FTPS.Client.FTPSClient.GetFile(String remoteFileName, String localFileName)\r\n   bei FtpSync.Program.Main(String[] args) in D:\\C#\\FtpSync\\FtpSync\\Program.cs:Line 24."    string

Mar 12, 2010 at 12:01 PM


please leave your output messages in German, half of my family is Austrian, I'm fluent enough in German to read exception details :-) 

there's just one strange thing: you wrote "d:\\test\\" in your first post and then the exception reports "c:\\test\\". Is this a translation mispelling?



Alessandro Pilotti [ MVP / IIS]




Mar 12, 2010 at 1:59 PM


is my english so bad? The drive letter change was just a test. I created a second folder on the c:\ drive for testing purposes. I will report back on monday...



Mar 12, 2010 at 2:06 PM


> is my english so bad?

Absolutely not! My intention was to suggest to leave the comments in German to avoid you the translation burden, your English is perfect :-)




Mar 15, 2010 at 9:56 AM


it's working now. It was just a missing file name specification on the GetFile() method. I was a bit confused, because in your code example on the home page there is no such specification. I must admit that I haven't read your code comments thoroughly enough. I should have seen it in the first place, sorry for that.