Skip to content

Instantly share code, notes, and snippets.

View tamalchowdhury's full-sized avatar
🔍
exploring open source

Tamal Chowdhury tamalchowdhury

🔍
exploring open source
View GitHub Profile
@tamalchowdhury
tamalchowdhury / app.jsx
Created May 10, 2022 08:41
Upload image in the client using Base64 strings
import { useState } from "react"
/**
* Takes a file from the file browser and
* converts into a base64 string
* Shows an alert when the file type does not match
* Function is outside so it can be portable
* @param {Blob} file
* @returns {Promise}
*/