adminjs-upload
adminjs-upload copied to clipboard
Request to add feature to limit types of files to be uploaded via file upload
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 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, }), ],