Skip to content

Instantly share code, notes, and snippets.

Avatar

Christoph Fink christophfink

View GitHub Profile
View fileReader-example.js
$("input:file").change(function(e){
var input=e.target;
// create a new FileReader object, and …
var reader=new FileReader();
// … tell it what to do in case of it successfully loading the file
reader.onloadend=function(e){
var fileBase64=e.target.result;
$(input).siblings("input:text").first().val(fileBase64);