skazantsev / WebDavClient

Asynchronous cross-platform WebDAV client for .NET Core
MIT License
155 stars 30 forks source link

Upload file to webdav using a stream #63

Open unconnected opened 3 years ago

unconnected commented 3 years ago

I use your lib for downloading files from a webdav server and works perfectly. I'm using it with the exposed stream that was later added here:

https://github.com/skazantsev/WebDavClient/pull/52

and using it like this:

https://github.com/skazantsev/WebDavClient/issues/31

I can also upload files, but not with progress report, since PutFile doesn't support streams the way GetRawFile() does. Is that something that is possible to add to the lib? Passing a stream to PutFile and then start writing to that stream so that the content is uploaded to the webdav server?

skazantsev commented 3 years ago

Hi @unconnected ,

I haven't tried this but I believe it's possible to get upload progress by passing an HttpClient instance with a custom message handler to the WebDavClient.

There's an example of such handler in one of old ASP.NET libs.

It would be nice to support progress of upload/download within the lib but I don't have near future plans to add it. But I'd be happy to accept Pull Requests for this.

unconnected commented 3 years ago

I haven't tried this but I believe it's possible to get upload progress by passing an HttpClient instance with a custom message handler to the WebDavClient.

Thanks for the heads up! I'll dive into this :P

DadOfTheDead commented 2 years ago

I haven't tried this but I believe it's possible to get upload progress by passing an HttpClient instance with a custom message handler to the WebDavClient.

Thanks for the heads up! I'll dive into this :P

Hi @unconnected, did you manage it? Looking for the same!

DadOfTheDead commented 1 year ago

Hi @unconnected ,

I haven't tried this but I believe it's possible to get upload progress by passing an HttpClient instance with a custom message handler to the WebDavClient.

There's an example of such handler in one of old ASP.NET libs.

It would be nice to support progress of upload/download within the lib but I don't have near future plans to add it. But I'd be happy to accept Pull Requests for this.

For me it worked perfectly using ProgressMessageHandler, thanks! Can be closed from my perspective.