import Intro from '/docs/snippets/breaking-change-page-intro.md'
import MigrationIntro from '/docs/snippets/breaking-change-page-migration-intro.md'
Strapi 5 uses koa-body v6#
Strapi 5 uses v6, which updates formidable to v2. This means uploaded files have new properties.
Breaking change description#
In Strapi v4
A user might create custom endpoints and handle files with the ctx object:
const endpoint = (ctx) => {
ctx.request.files.fileName.path
ctx.request.files.fileName.name
ctx.request.files.fileName.type
}
In Strapi 5
A user might still create custom endpoints and handle files with the ctx object, but the property names are different:
const endpoint = (ctx) => {
ctx.request.files.fileName.filepath
ctx.request.files.fileName.originalFilename
ctx.request.files.fileName.mimetype
}
Migration#
Notes#
- The official documentation lists the changes.
- The official documentation lists the changes.
Manual procedure#
Users need to manually update the properties used in their custom code, referring to the official and documentations.