File uploading to a custom controller worked in 4.15.0 but since upgrading to 4.20.4 we have noticed file uploads to our custom controllers have stopped working.
Anyone have the same issue or any ideas?
This topic has been created from a Discord post (1217037641556426833) to give it more visibility.
It will be on Read-Only mode here. Join the conversation on Discord
thanks, i went through all the releases and commits to try track something down but could not find anything obvious. I saw the ‘sizeInBytes’ change but doubt that would break anything.
I have more info on the issue I have raised:
Controller code:
export default factories.createCoreController('api::media.media', ({ strapi }) => ({
async create(ctx) {
const files = ctx.request.files // <- this is now empty {}
const filess = ctx.request.body.files // <- this is '[object Object]'
return strapi.service('api::media.media').create({files});
}
}))