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

Attach is possibly not sending the actual file to the app #40

Open
standvpmnt opened this issue Apr 4, 2022 · 1 comment
Open

Attach is possibly not sending the actual file to the app #40

standvpmnt opened this issue Apr 4, 2022 · 1 comment

Comments

@standvpmnt
Copy link

Issue

Setup:

  • Deno Version: 1.18.0
  • v8 Version: 9.8.177.6
  • Typescript Version: 4.5.2
  • SuperDeno Version: 4.8.0

Details

When using the .attach method on a request.post the body.value.read(), appears to be returning undefined for files. I am not sure what the reason for this might be, I have created a test-case showcasing the problem and can create a PR for the same if required. test case file

@standvpmnt
Copy link
Author

A work-around in the meantime that I was able to get working used the blob with the attach and that was working, but passing just the file path doesn't seem to be working.

const fil = await fetch(
      path.toFileUrl(
        path.resolve(".", "test", "temp_file.png"),
      ),
    ).then((res) => res.blob());
.attach(
      "file_key",
      fil,
      { contentType: "image/png", filename: "screenshot.jpg" },
    )

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

No branches or pull requests

1 participant