Skip to content
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

mimeType error with XML CSV #6473

Closed
PaquierThomas opened this issue May 23, 2024 · 2 comments
Closed

mimeType error with XML CSV #6473

PaquierThomas opened this issue May 23, 2024 · 2 comments
Assignees
Labels

Comments

@PaquierThomas
Copy link

Link to reproduction

No response

Payload Version

V3.beta35

Node Version

20.5.1

Next.js Version

next@14.2.3

Describe the Bug

The mimeType "text/csv" looks like it isnt supported by payload I try to upload .csv files but i get an mimeType error
Even got the same thing for .xml files ( "application/xml" )
image

Image works fine, same for pdf, but not for xml .csv

Reproduction Steps

You have to create a collection, upload field then mimeTypes inside with "application/xml" or "text/csv",

here is the full code

import { CollectionConfig } from "payload/types";

export const Documents: CollectionConfig = {
slug: "documents",
admin: {
useAsTitle: "filename",
},
access: {
read: () => true,
},
upload: {
staticURL: "/documents",
staticDir: "documents",
mimeTypes: ["application/xml"],
},
fields: [{ name: "alt", label: "Alt", type: "text", required: false }],
};

export default Documents;

image

Adapters and Plugins

no plugins

@denolfe denolfe self-assigned this May 24, 2024
@denolfe
Copy link
Member

denolfe commented May 24, 2024

Resolved via Discord.

The provided mimetype in mimeTypes was actually not correct. To see the actual mimetype that is detected, remove the mimeTypes field, upload file, and look at the API response - adjust mimeTypes list accordingly.

@denolfe denolfe closed this as completed May 24, 2024
Copy link

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants