Skip to content

Vanilla JS to implement Bootstrap based progressbar to indicate file size quota on frontend, supporting both multiple file inputs and single file inputs with 'multiple' atribute.

License

Notifications You must be signed in to change notification settings

antoniobarranco/vanilla-js-input-filesize-progressbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vanilla JS input filesize progressbar

Vanilla JS to implement Bootstrap based progressbar to indicate file size quota on frontend, supporting both multiple file inputs and single file inputs with 'multiple' atribute.

It scans the entire DOM to detect any combination of file inputs with or without 'multiple' atribute. It sums all filesizes and represents on a progressbar to easily detect if your form exceeds the allowed upload value that you set as a constant.

How to use on your website

You can check and use this code to insert progressbar quota functionality on your website without any framework or library dependency because all is Vanilla JS code. One great thing is that you can use it easily on simple from complex scenarios without any code collistion.

The example uses Bootstrap progressbar, but you can adapt it to any other frontend CSS framework in a couple of minutes.

Demo

You can check an online demo here.

(Form in demo is not linked to any action, so files are never uploaded)

About

Vanilla JS to implement Bootstrap based progressbar to indicate file size quota on frontend, supporting both multiple file inputs and single file inputs with 'multiple' atribute.

Topics

Resources

License

Stars

Watchers

Forks