ramondeklein / nwebdav

.NET implementation of the WebDAV protocol
MIT License
155 stars 42 forks source link

Handling slow/async store #28

Closed TopperDEL closed 6 years ago

TopperDEL commented 6 years ago

Hi,

I try to implement a WebDAV-Store, that loads data from another library from the net. That library provides the result only as a file on my file-System (temp-file). So whenever a user selects a file in my store, I Need to fetch the complete file first to my local hard drive and Can then provide a file-stream on it.

Is there any way to create a Kind of async-filestream that provides new data-chunks whenever they got written to the temp-file? I'm a bit lost, currently and appreciate any help.

Thank you!

Kind regards,

TopperDEL

ramondeklein commented 6 years ago

If the library only provides an option to download the file to disk and doesn't allow stream-based access, then it's difficult to accomplish this. If the other library doesn't lock the file for reading, then you could try to start reading from the stream chunk-by-chunk and have some kind of notification that the file has been written completely. You need to create an intermediate-stream to provide this functionality, because the default file-stream will probably not allow this.

I understand that it's not possible to get a stream from your third-party library, but this is actually the only decent solution. If possible, contact the library's creator and ask for stream-based access.

TopperDEL commented 6 years ago

Thank you for your quick Reply! I will evaluate if a stream-based Access is possible. Maybe I get it working with an intermediate stream.

Closing this issue, as it is only work on my side.