sparkeh9/CoreFTP

Upload Stream

Closed this issue · 2 comments

Hello, how can I upload a stream?

Everything is based on streams in this library - If you look at the readme, there's an example already: https://github.com/sparkeh9/CoreFTP#uploading-from-a-local-filestream-to-the-ftp-server

But you can take a look at the link below for a working code example:
https://github.com/sparkeh9/CoreFTP/blob/master/tests/CoreFtp.Tests.Integration/FtpClientTests/Files/When_opening_a_file_for_upload.cs#L44.

But basically,
var writeStream = await ftpClient.OpenFileWriteStreamAsync( "yourfile.jpg" );
await yourStream.CopyToAsync(writeStream)

Thanks for your quick response. I'll to test