Skip to content

Locked files after download #22

Description

@ficiyoki

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.

Activity

  1. shanielh commented on Sep 6, 2018

    @shanielh

    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.

  2. czesiu20 commented on Apr 16, 2019

    @czesiu20

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions