filepond-plugin-file-validate-size icon indicating copy to clipboard operation
filepond-plugin-file-validate-size copied to clipboard

Support max file size per file type

Open hbgl opened this issue 5 years ago • 2 comments

Hi, thanks for the great plugin.

I want my users to be able to upload images and videos using the same filepond uploader. For images I want a smaller max file size and for videos I want a bigger max file size.

Would it make sense to add this configuration to the plugin? Something like this would fit the use-case perfectly:

const filePondOptions = {
  maxFileSize: {
    "image/*": 5242880,
    "image/png": 10485760,
    "video/mp4": 104857600,
  },
}

Cheers

hbgl avatar Jan 16 '19 19:01 hbgl

I'll consider this. In the meantime, I think it would be fastest to fork the repo and create a custom plugin.

rikschennink avatar Jan 17 '19 07:01 rikschennink

I definitely need this too.. Please consider my PR as there hasn't been any other movement on this in nearly 5 years. 😊

Anyone else in need, unless/until this is merged and released, you can use by adding to your dependencies, thusly:

"filepond-plugin-file-validate-size": "[email protected]:willvincent/filepond-plugin-file-validate-size.git",

Can't load from cdn though, of course.

willvincent avatar Nov 21 '23 21:11 willvincent