Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream a file larger than 2GB #27

Closed
gdgudmundson opened this issue Jul 30, 2018 · 5 comments
Closed

Stream a file larger than 2GB #27

gdgudmundson opened this issue Jul 30, 2018 · 5 comments
Assignees
Labels
Milestone

Comments

@gdgudmundson
Copy link

How do I set the WebDavClient to allow GetRawFile to stream a file larger than 2GB

@skazantsev skazantsev added the bug label Aug 7, 2018
@skazantsev
Copy link
Owner

@gdgudmundson it looks like a bug in the library.

Currently, if you download a file using WebDavClient it tries to load it fully into memory instead of actually streaming it.

It can be fixed by adding HttpCompletionOption.ResponseHeadersRead to a request that is made by the underlying HttpClient but it requires additional changes to API to make response of GetRawFile and GetProcessedFile disposable.

I plan to fix it and release a new version of the library soon.

@skazantsev skazantsev added this to the 2.3.0 milestone Aug 7, 2018
@skazantsev skazantsev self-assigned this Aug 7, 2018
@gdgudmundson
Copy link
Author

Another thing to consider is the ContentLength property on the WebDavResource class is an integer which only allows for 2GB file. It would need to be a long to support larger files.

I look forward to a new version.

Thanks!

@skazantsev
Copy link
Owner

Yeah, nice catch!

skazantsev added a commit that referenced this issue Aug 8, 2018
skazantsev added a commit that referenced this issue Aug 8, 2018
* Support getting large files (#27)

* Changed WebDavResponse->ContentLength type of long
@skazantsev
Copy link
Owner

I have implemented a fix and released a new version to NuGet.

@tipa
Copy link

tipa commented Feb 2, 2023

Any chance to make this an option in GetFileParameters so we can decide what HttpCompletionOption to use? In my use-case I am loading the stream into memory anyways and in order to call the Length or Position properties on the returned Stream from HttpClient, the HttpCompletionOption needs to be ResponseContentRead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants