Receive a file when sending from a client without multipart. #241
-
Browser send payload ------WebKitFormBoundaryYO9WpPGAq2TVdb7i ------WebKitFormBoundaryYO9WpPGAq2TVdb7i-- in handler in req.urlencoded() contains all data, multipart is empty. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi, you should use multipart because multipart allows for the file to be gradually streamed. Alternatively, what you can do is pipe the I will say your payload does look like a multi-part payload to me, so why don't you try following this guide to implement a potential solution https://github.com/kartikk221/hyper-express/blob/master/docs/MultipartField.md |
Beta Was this translation helpful? Give feedback.
-
I did it as in your example
console output
if I send from a client I temporarily solved it using formidable
console output
But I think that the framework should solve such issues effortlessly. This is a completely standard situation. |
Beta Was this translation helpful? Give feedback.
Hi, you should use multipart because multipart allows for the file to be gradually streamed.
Alternatively, what you can do is pipe the
Request
to one of your own form handlers as theRequest
forhyper-express
is aReadableStream
which can be used to consume raw body data.I will say your payload does look like a multi-part payload to me, so why don't you try following this guide to implement a potential solution https://github.com/kartikk221/hyper-express/blob/master/docs/MultipartField.md