Home Forums .NET libraries Xceed SFTP/FTP for .NET Send multiple files simultaniously with one login

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20893 |

    Hi,

    I have a winform that handles the creation and login of the AsyncFtpClient. I need to upload multiple files at the same time while returning progress for each file. For example, I have 10 files and I need to start 10 uploads to run simultaneously with Async updates to their respective progress bars.

    I got one file upload working correctly. The main form creates the FTP object and logs in. Once logged in I create a new thread that then adds a UserControl that houses the send file FTP commands etc… to a panel. When adding the UserControl I pass in the created FTP object, the local folder to pull the file from and the file name to upload. This works great for one file. I tried using 2 files and creating 2 threads which adds 2 UserControls to the panel. This works fine up to the point where the send happens. The FTP object sends back an error when attempting to send the second file “the connection is in use”. I know this object supports sending multiple files but it seems to send them one after another not simultaneously. I need to send my files simultaneously.

    Thanks,
    Dan

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Dan (had 3088 views)

    Xceed Support
    Member
    Post count: 5658

    The FTP protocol, by definition, does not support multiple uploads with the same connection.

    In order to achieve that, 2 conditions must be met:

    1-You must start a new connection for each upload, that is, a new instance of the ASyncClient for every upload.

    2-Your server must allow multiple connections from the same user.

    Documentation on the ASyncFtpClient:
    <a href=” http://doc.xceedsoft.com/products/XceedFileSystem/topic1014.html “> http://doc.xceedsoft.com/products/XceedFileSystem/topic1014.html </a>

    Documentation on the SendMultipleFiles Method (not simultaneously):
    <a href=” http://doc.xceedsoft.com/products/XceedFileSystem/topic1302.html “> http://doc.xceedsoft.com/products/XceedFileSystem/topic1302.html </a>

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by CharlesB (had 3344 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.