Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shubhambhartiya08 opened this issue Apr 27, 2021 · 1 comment

Comments

@shubhambhartiya08
Copy link

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.

@everythinginjs
Copy link

@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, }), ],

@dziraf dziraf transferred this issue from SoftwareBrothers/adminjs Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants