Steve Kiss
Steve Kiss

Reputation: 1118

FTP Several Files

I have what would seem like a common problem, but I cannot find an appropriate solution on any forums. I need to FTP an entire directory structure using .NET. I have found several code examples all of which show how you can FTP a single file by creating an FtpWebRequest object. Unfortunately, there is no information on how to deal with several files. Do I simply create a FtpWebRequest object for every single file?

Upvotes: 2

Views: 271

Answers (2)

turtlepick
turtlepick

Reputation: 2714

You can always call a new Process with a command like using for example WinSCP (open source FTP client)
https://winscp.net/eng/docs/start

Perhaps call the synchronize operation:
https://winscp.net/eng/docs/scriptcommand_synchronize

Upvotes: 1

Jonathan Wood
Jonathan Wood

Reputation: 67213

If there's a shorter way, I don't know what it is.

I wrote my code to handle each file one by one. If you are dealing with entire directory structures, that would entail processing each directory one by one as well.

Upvotes: 0

Related Questions