adminjs-upload icon indicating copy to clipboard operation
adminjs-upload copied to clipboard

Request to add feature to limit types of files to be uploaded via file upload

Open shubhambhartiya08 opened this issue 4 years ago • 1 comments

Hi there,

We have been using Admin bro for quite a while now and have been super helpful on dev and turnaround time. Kindly allow us to have this feature so that we can close our VAPT requirements as well.

shubhambhartiya08 avatar Apr 27 '21 08:04 shubhambhartiya08

@shubhambhartiya08 currently this feature is available nicely through Upload Feature for AdminBro it's so easy and straightforward you just need to define mimeTypes in an array like

const validation = { mimeTypes: ['audio/mpeg'], }; and then in your array of features just add validation

module.exports = { options, resource: Mp3, features: [ uploadFeature({ provider: new MyProviderForMp3(), properties: { key: 'mp3File.path', bucket: 'mp3File.folder', mimeType: 'mp3File.type', size: 'mp3File.size', filename: 'mp3File.filename', file: 'mp3File', }, uploadPath: (record, filename) => ${filename}, validation, }), ],

everythinginjs avatar Apr 28 '21 07:04 everythinginjs