superdeno icon indicating copy to clipboard operation
superdeno copied to clipboard

Attach is possibly not sending the actual file to the app

Open standvpmnt opened this issue 2 years ago • 1 comments

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 avatar Apr 04 '22 04:04 standvpmnt

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" },
    )

standvpmnt avatar Apr 04 '22 04:04 standvpmnt