Skip to content

Instantly share code, notes, and snippets.

@messick
Forked from alexmcpherson/upload.coffee
Created March 13, 2013 17:58
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 messick/5154555 to your computer and use it in GitHub Desktop.
Save messick/5154555 to your computer and use it in GitHub Desktop.
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