Skip to content

Instantly share code, notes, and snippets.

View Siddharth77's full-sized avatar
🥷
JavaScript|Angular|React Developer

Siddharth Jain Siddharth77

🥷
JavaScript|Angular|React Developer
  • Pune | Khargone(WFH)
  • 15:44 (UTC +05:30)
View GitHub Profile
@resistancecanyon
resistancecanyon / multipleImageContentReader.js
Last active May 7, 2024 15:48
Reading Multiple Image Base64 data using Es6 Async/Await in a html:type:file input
// html
// <input type="file" onchange="imagesSelected" multiple accept=".gif,.jpg,.jpeg,.png" />
async function imagesSelected(event) {
let files = [...event.target.files];
let images = await Promise.all(files.map(f=>{return readAsDataURL(f)}));
//all images' base64encoded data will be available as array in images
}
function readAsDataURL(file) {