diff --git a/packages/strapi-plugin-upload/controllers/Upload.js b/packages/strapi-plugin-upload/controllers/Upload.js index 5fd80a189a..ee9dda9e93 100644 --- a/packages/strapi-plugin-upload/controllers/Upload.js +++ b/packages/strapi-plugin-upload/controllers/Upload.js @@ -55,7 +55,7 @@ module.exports = { const buffers = await uploadService.bufferize(files); const enhancedFiles = buffers.map(file => { - if (file.size > config.sizeLimit) { + if (parseFloat(file.size) > parseFloat(config.sizeLimit)) { return ctx.badRequest(null, [ { messages: [ @@ -208,10 +208,9 @@ const searchQueries = { return ({ id }) => { return model .query(qb => { - qb.whereRaw('LOWER(hash) LIKE ?', [`%${id}%`]).orWhereRaw( - 'LOWER(name) LIKE ?', - [`%${id}%`] - ); + qb.whereRaw('LOWER(hash) LIKE ?', [ + `%${id}%`, + ]).orWhereRaw('LOWER(name) LIKE ?', [`%${id}%`]); }) .fetchAll() .then(results => results.toJSON());