Skip to content

Instantly share code, notes, and snippets.

View christophfink's full-sized avatar

Christoph Fink christophfink

View GitHub Profile
$("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);