Skip to content

Instantly share code, notes, and snippets.

@john92paul
Last active January 20, 2020 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john92paul/e7376d4fe464f6c70a5deaf508c26364 to your computer and use it in GitHub Desktop.
Save john92paul/e7376d4fe464f6c70a5deaf508c26364 to your computer and use it in GitHub Desktop.
<script>
if(e.target.files) {
let imageFile = e.target.files[0]; //here we get the image file
var reader = new FileReader();
reader.readAsDataURL(imageFile);
reader.onloadend = function (e) {
// Converted image is available here.
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment