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

Locked files after download #22

Open
ficiyoki opened this issue Sep 5, 2018 · 2 comments
Open

Locked files after download #22

ficiyoki opened this issue Sep 5, 2018 · 2 comments
Labels

Comments

@ficiyoki
Copy link

ficiyoki commented Sep 5, 2018

I have a problem were once files are downloaded (e.g using the FileHandler) the files remain locked because the ContentStream of the HttpResponse is never closed/disposed.
Is there a way around this? I feel the file should be released once the transfer is complete.

@shanielh
Copy link

shanielh commented Sep 6, 2018

Hi @ficiyoki, this repository is no longer maintained, you're welcome to create a pull request and I'll merge it if everything looks good.

@shanielh shanielh added the bug label Sep 6, 2018
@czesiu20
Copy link

Just close the stream after the content is written.

    public async Task WriteBody(StreamWriter writer) {
        ContentStream.Position = 0;
        await writer.FlushAsync().ConfigureAwait(false);
        await ContentStream.CopyToAsync(writer.BaseStream).ConfigureAwait(false);
        //close the stream

--> ContentStream.Close();
}

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