kartik-v / bootstrap-fileinput

An enhanced HTML 5 file input for Bootstrap 5.x/4.x./3.x with file preview, multiple selection, and more features.
http://plugins.krajee.com/file-input
Other
5.36k stars 2.4k forks source link

Get File Sizes? #214

Closed idevwebs closed 9 years ago

idevwebs commented 9 years ago

This is a great file upload solution. I'd like to present information to the user as to file sizes when they select files to upload. So that they know ahead if they're going to be over the limit before attempting to upload. How can I get file sizes of files that are added to the field before actually uploading? Is it possible? Please advise.

Thank you

kartik-v commented 9 years ago

The file sizes can be validated via the plugin using maxFileSize property.

If you want to read file size - you can use the reader object and the filestack passed via some relevant events like fileloaded.

kartik-v commented 9 years ago

Probably may add it as an enhancement for future to display filesizes if needed...