![]() |
Blaze UI is a free open-source UI Toolkit that provides a great structure for building websites quickly with a scalable and maintainable foundation. All components in Blaze UI are developed mobile-first and rely solely on native browser features, not a separate library or framework. It helps us to create a scalable and responsive website fast and efficiently with a consistent style. In this article, we will be seeing Blaze UI File Upload events. There are two events for the File Upload component named “uploading” and “uploaded”. Those events are listed below. Blaze UI File Upload Events:
Syntax: const el = document.querySelector('blaze-file-upload'); el.addEventListener('event-name', (e) => { ... }); Example 1: In this example, we show how to execute some code when the uploading event is triggered. HTML
Output: ![]() Example 2: In this example, we used the file uploaded event to show an alert message when the file is completed uploading. For this, we have to create an endpoint to receive the file uploads. We have “server.js” file for the NodeJS server for the “/upload” endpoint. HTML
server.js (For accepting file uploads) Javascript
Output: ![]()
Reference: https://www.blazeui.com/components/file-upload/ |
Reffered: https://www.geeksforgeeks.org
CSS |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |