0

I'm using FTP servers on the Load Balanced FTP cluster. I need to put related files to a single server.

Can I upload one file to several different directories by one FtpWebRequest?

Avant
  • 3
  • 1

2 Answers2

0

You can't. First of all since the ftp protocol is intended to works on request basis, and second, since each FtpWebRequest has a specific path, you need to create a request for each directory in which you want to upload.

valentin
  • 667
  • 2
  • 12
  • 19
  • So I have no any way to guarantee uploading related files to the same FTP server? – Avant Feb 28 '14 at 14:32
  • It's possible that you could try to set the KeepAlive property to true for all your related files, but I can't say if that will keep all the files on the same machine. It's worth a try, though, if you can. See this answer: http://stackoverflow.com/a/20326576/2463738 – valentin Feb 28 '14 at 14:59
0

I've resolved this issue using KeepAlive property of FtpWebRequest. While KeepAlive is true all files from different requests will be uploaded to a single server.

Avant
  • 3
  • 1