node-fetch v3.1 has a own formData decoder now #686
Replies: 4 comments 4 replies
-
Hi ! const fd = await request.formData();
const pdf = fd.get('attachment') // This actually returns a string Could this be used to send files with form actions in Remix ? |
Beta Was this translation helpful? Give feedback.
-
Maybe we could update remix source code to use that new |
Beta Was this translation helpful? Give feedback.
-
@jimmywarting thank you for letting us know about the FormData implementation in node-fetch. I wasn’t aware it existed. how do you handle streaming file uploads to external storage, like S3? |
Beta Was this translation helpful? Give feedback.
-
I just looked into the |
Beta Was this translation helpful? Give feedback.
-
Hi, i saw remix in a weekly js newsletter and read on your page that you can kind of do:
This spark my interest so i investigated how it was being done and found this:
remix/packages/remix-node/fetch.ts
Lines 19 to 22 in a69a631
Saw that you do actually use node-fetch 👍 🙂
We have finally implemented a own 100% spec compatible FormData decoder ourself into node-fetch v3.1 that handles both url encoded and multipart/formdata payload. so you can deal with things such as File uploads also
tip if you want to use the FormData, Blob and File class node-fetch uses then you could do:
Beta Was this translation helpful? Give feedback.
All reactions