files/api/upload/controllers/Upload.js
function (fieldname, file, filename) {
          const acceptedExtensions = strapi.api.upload.config.acceptedExtensions || [];
          if (acceptedExtensions[0] !== '*' && !_.contains(acceptedExtensions, path.extname(filename))) {
            this.status = 400;
            this.body = {
              message: 'Invalid file format ' + filename ? 'for this file' + filename : ''
            };
          }
        }
function (fieldname, file, filename) {
          const acceptedExtensions = strapi.api.upload.config.acceptedExtensions || [];
          if (acceptedExtensions[0] !== '*' && !_.contains(acceptedExtensions, path.extname(filename))) {
            this.status = 400;
            this.body = {
              message: 'Invalid file format ' + filename ? 'for this file' + filename : ''
            };
          }
        }
function ( fieldname , file , filename ) { const acceptedExtensions = strapi . api . upload . config . acceptedExtensions || [ ] ; if ( acceptedExtensions [ 0 ] !== '*' && ! _ . contains ( acceptedExtensions , path . extname ( filename ) ) ) { this . status = 400 ; this . body = { message : 'Invalid file format ' + filename ? 'for this file' + filename : '' } ; } }
Validation used by `co-busboy`.
Validation used by co - busboy .