Skip to content

Image not written to disk #112

Description

@andreialecu

We have been trying docunotion and ran into an issue where an image that was being downloaded was not making it to the disk correctly.

I tracked it down to this line:

fs.createWriteStream(path).write(buffer); // async but we're not waiting

Changing it to fs.writeFileSync(path, buffer) fixes the issue.

It's unclear why the code does not await for the file to be written, is there any reason for that?

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions