Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Created March 13, 2013 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexmcpherson/5154247 to your computer and use it in GitHub Desktop.
Save alexmcpherson/5154247 to your computer and use it in GitHub Desktop.
Image Preview on upload
handleFileUpload: (e) ->
file = e.target.files[0]
reader = new FileReader();
reader.onload = (e) =>
@image = new Image()
@image.onload = @renderImage
@image.src = e.target.result
reader.readAsDataURL(file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment