You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Payload v3 accepts only single file uploads, export fetchAPIFileUpload as a workaround #10125
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.
Additional issue: if filename contains a # it will not be processed by s3 correctly resulting in a failed upload. Try uploading attached file: Trollface # 31337.png.zip
To summarize all issues with addDataAndFileToRequest:
Got mine to work without the need of a post install script, but with a direct node_modules import. I also implemented custom logic that layers form data like v2 did, with the added bonus that adds files directly alongside those fields.
Nice one, I only take a single JSON field, no reason not to parse all. though stripe tends to shoot 0 length POST at my endpoints from time to time, keep that in mind (will crash)
Sorry you didn't get a response on this sooner. Is this still reproducible on the latest v3 version (v3.86.0)? If so, could you confirm your repro steps still apply there and we'll take another look.
Activity
max-degterev commentedon Dec 21, 2024
Temporary hackfix:
run this in "postinstall"
max-degterev commentedon Dec 21, 2024
And this brings back the old style of body parsing, automatically finding data field and safely parsing as JSON as a bonus
max-degterev commentedon Dec 29, 2024
Additional issue: if filename contains a
#it will not be processed by s3 correctly resulting in a failed upload. Try uploading attached file: Trollface # 31337.png.zipTo summarize all issues with addDataAndFileToRequest:
_payloadmax-degterev commentedon Jan 14, 2025
Hey guys any chance to get
fetchAPI-multipartexported in the meantime?RickGeersing commentedon Feb 11, 2025
What is the status of this issue? This blocks an upgrade for one of our customers
RickGeersing commentedon Feb 11, 2025
Got mine to work without the need of a post install script, but with a direct
node_modulesimport. I also implemented custom logic that layers form data like v2 did, with the added bonus that adds files directly alongside those fields.max-degterev commentedon Feb 11, 2025
Nice one, I only take a single JSON field, no reason not to parse all. though stripe tends to shoot 0 length POST at my endpoints from time to time, keep that in mind (will crash)
JessRynkar commentedon Jul 14, 2026
Sorry you didn't get a response on this sooner. Is this still reproducible on the latest v3 version (v3.86.0)? If so, could you confirm your repro steps still apply there and we'll take another look.
fix: resolve six request, validation and developer tooling reports
fix: address 24 Payload read, schema, version and tooling reports (#9)