-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payload v3 accepts only single file uploads, export fetchAPIFileUpload as a workaround #10125
Labels
status: needs-triage
Possible bug which hasn't been reproduced yet
Comments
max-degterev
added
status: needs-triage
Possible bug which hasn't been reproduced yet
validate-reproduction
labels
Dec 21, 2024
Temporary hackfix:
run this in "postinstall" |
And this brings back the old style of body parsing, automatically finding data field and safely parsing as JSON as a bonus
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
Payload v2 used to be able to handle any shape of multipart data and parse files accordingly. v3 is only able to find a single file named
file
.Ideally as a long term solution it would be great to have payload automatically figure out data types passed in a multipart body and create matching data structure. So just
req.files = files
and done I guess...As a quick and dirty fix it would be also great to just expose
fetchAPIFileUpload
so that end users can easily create custom body parsers while still using global payload upload configuration.Link to the code that reproduces this issue
https://github.com/payloadcms/payload/blob/main/packages/next/src/fetchAPI-multipart/index.ts
Reproduction Steps
upgrade to v3
make sad noises attempting to migrate file uploads
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
The text was updated successfully, but these errors were encountered: