Hey little question,
Does the mimeType "text/csv" isnt supported by payload? I try to upload .csv files but i get an mimeType error
Edit: even got the same thing for .xml files ( application/xml)
error screen, got the same thing for "text/csv"
Tried with pdf "application/pdf" it works but not for xml csv
what version of Payload are you using, and what DB are you using?
for instance i used the docs of mdn here
latest version and postgres
v3 or v2?
v3
ok, v3 is still in beta so there are still some kinks being worked out
ouch
the most recent version includes a change to the uploads collection type, specifically for image uploads and focal point cropping. Try using beta.34
how may i change to test?
yarn add payloadcms@beta.34
then also downgrade all other payload plugins and tools that have the "beta" version
if node = npm install payloadcms@beta.34, and if i put in beta will there be issues to my existing code? I use no plugins atm
If you used npm then do
npm installrather than
yarn add. Before you do though, can you try uploading an image? Make sure to change the mimeTypes to allow images
if the image upload works, I am 99% sure it's caused by the latest commit from
@967118574445547650already made images with another collections called media and it works
here is the screen
ok cool. If you roll back your payload version and it works, then that means the latest update has a breaking change
We can create an issue to get it fixed 🙂
just a question how do i roll back after getting into beta?
just do
npm install payload@beta.34you are just rolling back minor versions of the v3 beta
you are currently on beta.35 if you have the latest
ahhh ok ok, i'm creating the issue, ty for your help till now
if i do not use next.js what do i put in the field ?
if you are using Payload v3, it uses NextJS
thanks!!
thanks for your help, gonna eat and then try the beta 34 thing
If you remove the mime type prop and then upload each of those files. What does the detected mime type say in the data? I'm guessing that the detected mime type may be slightly different than what you're setting in code.
With your method it does work, i remove mimetype and i can upload both files, (csv and xml),
In my case, i wont make the mistake when i upload, but for my client is their no way to limit them only to csv and xml?
What does the detected mime type say in the data?
Check the data for what mime type was detected for those files. API tab.
thanks a lot will do!
application/vnd.ms-excel for CSV
text/xml for XML
IS THE ANSWER
Just a note, csv files not created in excel might have a slightly different mimetype. You can probably test that and also add it to the array.
Noted will do all cases then, thanks a lot for your help and thanks Mark too
Star
Discord
online
Get dedicated engineering support directly from the Payload team.