I am writing a .NET application in C# that needs to upload some files onto a server using FTP. I am looking at the UploadFileAsync method provided by he WebClient class:
http://msdn.microsoft.com/en-us/library/ms144232(v=vs.80).aspx
What I am curious about is what happens if I tell it to upload a directory?
In my dreams it would recursively upload the directory and all of its contents…. Does anybody have any experience with this, or know any way I could get all the files up there without having to go through and manually create the sub directories and upload the files one by one?
It will not work like that. If you pass a directory, you’ll get an error. There’s no shortcut of the kind you seek, unfortunately.