Upload Stream
Closed this issue · 2 comments
ricardobeckssa commented
Hello, how can I upload a stream?
sparkeh9 commented
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)
ricardobeckssa commented
Thanks for your quick response. I'll to test