Replies: 2 comments 1 reply
-
Run into this myself. I'm doing something like this:
But there is room for improvements |
Beta Was this translation helpful? Give feedback.
1 reply
-
request.formData().then(async (s) => {
const b = s.get('file') as File
console.log(b.type, b.name)
// @ts-ignore: fixme
const blob = new Blob([b], { type: b.type })
const buffer = Buffer.from(await blob.arrayBuffer())
const buff = Buffer.from(new Uint8Array(await blob.arrayBuffer()))
const savedTo = `public/uploads/${b.name}`
fs.writeFile(savedTo, buff, () => console.log(`saved ${savedTo}`))
})
Any help much appreciate, been very long trying to make this work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hello, i am new to solidjs, any suggestion for handling file uploaded using API Event Route?
i have created upload file using fetch, and sent to API Route (POST)
i can't get any file even using formidable like this
or maybe i missing something?
Beta Was this translation helpful? Give feedback.
All reactions