Closed Koikarp8877 closed 6 months ago
I can't help you with the nextjs side of things. If the client is converting binary data to UTF-8 and mangling the data in the process or anything like that, that's something you will have to solve on the nextjs end.
As far as the "unexpected end of form" goes, it's most likely going to be one of:
I can't help you with the nextjs side of things. If the client is converting binary data to UTF-8 and mangling the data in the process or anything like that, that's something you will have to solve on the nextjs end.
As far as the "unexpected end of form" goes, it's most likely going to be one of:
- The client is not sending the request in the proper format
- Somewhere on the server side the request data stream is being severed
- If you're using the node http server it may be timing out the request if the request is taking too long.
Thanks for answering !
So there is no apparent issue with how i handle the file upload in this code ?
I will try all you suggestions, thanks again for your time !
So there is no apparent issue with how i handle the file upload in this code ?
Not really.
What do you mean by this ? Is it possible to send multipart without form-data ?
Thanks for your time.
Is it possible to send multipart without form-data ?
busboy
only supports multipart/form-data
and application/x-www-form-urlencoded
because those are the traditional formats transmitted by browsers when submitting HTML forms. For any other format you will need to handle that yourself if you cannot reconfigure the client to use one of the two supported formats.
Hello again,
I've solved the issue ; You were righr, the issie indeed lied in the way next js was handling the data.
Thanks again for your help !
Hello, i'm trying to upload files on my nextjs 14.0.4 app with busboy, however, while the files upload in the right repo, with the right name and right extension, they are unsuable "Not a JPEG file: starts with 0xef 0xbf", exemple with an jpeg file.
This was my original issue, however, after this, and changing to the busboy v 1.6.0. I get "Error: Unexpected end of form". I tried all the version starting from 1.0.0.
The full console output :
And here is my full code
I double checked the files are fine. It's my first nextjs app, any help would be greatly aprreciated. Thanks for your time.
Ps : sorry for the previous versions, i sent the wrong code.