Multi-File Upload Form with Preview and Remove Feature using Bootstrap 5.3 and jQuery
This tutorial will show you how to build a beautiful, user-friendly multi-file upload form using HTML, Bootstrap 5.3, and jQuery. This upload form allows users to select multiple files, preview the file names and sizes, and remove any file before submission — all with a sleek and modern interface.
Features
-
Upload multiple files at once
-
File size formatting (e.g., KB, MB)
-
Duplicate file prevention
-
Remove selected files before uploading
-
Fully responsive using Bootstrap 5.3
Live Demo Screenshot
Full HTML Code
How It Works
-
HTML & Bootstrap:
-
The form uses Bootstrap's grid system and form components to create a clean UI.
-
The file input allows multiple file selection (
multiple
attribute).
-
-
JavaScript with jQuery:
-
When files are selected, the script stores them in a
files
array. -
It prevents duplicate files by checking the name and size.
-
File names, sizes, and a "remove" icon are shown in a styled list.
-
Users can remove files from the list before submitting.
-
A an
DataTransfer
object is used to update the backendinput.files
so that backend still receives the correct files.
-
Customization Ideas
-
Add image thumbnails for preview
-
Limit file types (e.g., only
.jpg
,.pdf
) -
Add drag-and-drop support
-
Show total file size
-
Add server-side upload handling with PHP, Laravel, or Node.js
Conclusion
This file upload form gives users full control over the files they’re submitting while maintaining a modern and mobile-friendly layout. It’s great for any kind of upload interface — from simple forms to complex media submissions.