Skip to content

Conversation

@diraneyya
Copy link
Contributor

file uploads were previously failing due to requiring the mime-type of the uploaded file to be specified in a form-data field called "type" which was not being included in the POST request

this pull request fixes that

@diraneyya
Copy link
Contributor Author

@bryantgillespie Can you review this?

if (asset.title) form.append('title', asset.title)
if (asset.description) form.append('description', asset.description)
if (asset.folder) form.append('folder', asset.folder)
if (asset.type) form.append('type', asset.type)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the line that fixes the error I was facing when applying the AgencyOS template. See screenshot:

image

In text:

 ›   Warning: Directus Error: Invalid payload. "type" is required. (Status: 400) {"reason":"\"type\" is 
 ›   required","code":"INVALID_PAYLOAD"}
-- Request failed with status 400. Not retrying. Directus Error: Invalid payload. "type" is required. (Status: 400) {"reason":"\"type\" is required","code":"INVALID_PAYLOAD"}

@bryantgillespie bryantgillespie merged commit d515b15 into directus-labs:main Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants