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
Unsupported Media Type for Patching file #11335
Comments
I can cofirm I have the same issue in my instance. |
Do you want to replace the file itself or just the metadata? How does your request look like? From the docs:
|
I was able to duplicate this issue in a different way. I uploaded an image to attach it to an object in a collection, using the admin UI. Context: CMS nerd but Directus n00b, just learning all the things, before I get to API internals & GraphQL. Later when I tried to rename the title using file editor in the admin UI, it gave this same error. We cannot edit titles, filenames or add descriptions/tags to any images. For reference, this was a .jpg file that renders nicely. 9.5.0 as well, Postgres 13 as well, Node v16 (Windows 10) locally. yuk IK but I do server development with windows gaming. running node v14, Ubuntu 20 & PG 10 on the server. LMK if there's more I can do to help than just raise my hand & say: this is a bigger/broader problem than it may seem. |
Preflight Checklist
Describe the Bug
For updating FILE can be used json, and multiform mediatypes (https://docs.directus.io/reference/files/#update-a-file)
At now you recieve reject when send application/json mediatype data for PATCH /files/:id
To Reproduce
Send request for update direactus file data (title, tags, etc...) in application/json mediatype
Errors Shown
{
"errors": [
{
"message": "Unsupported Content-Type header",
"extensions": {
"code": "UNSUPPORTED_MEDIA_TYPE"
}
}
]
}
What version of Directus are you using?
9.5.0
What version of Node.js are you using?
17.4.0
What database are you using?
Postgres 13
What browser are you using?
Firefox
What operating system are you using?
Linux 5.4.0-42-generic
How are you deploying Directus?
Kubernetes
The text was updated successfully, but these errors were encountered: