Skip to content

Instantly share code, notes, and snippets.

@nickbewley
Created March 18, 2015 20:54
Show Gist options
  • Save nickbewley/0d293ac43360e0914c1a to your computer and use it in GitHub Desktop.
Save nickbewley/0d293ac43360e0914c1a to your computer and use it in GitHub Desktop.
Axure File Upload and Save — Check for File Inputted
// Getting the file name and contents from the input field
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('[data-label="UploadPreview"]').children('img').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
// When the file input field changes do above function
$('#UploadInput').change(function(){
readURL(this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment