superdeno
superdeno copied to clipboard
Attach is possibly not sending the actual file to the app
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
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" },
)