Skip to content

Instantly share code, notes, and snippets.

@watert
Created March 12, 2015 15:38
Show Gist options
  • Save watert/e2aba9d560f7e3891d80 to your computer and use it in GitHub Desktop.
Save watert/e2aba9d560f7e3891d80 to your computer and use it in GitHub Desktop.
upload file with modern browser way with coffeescript and jquery
$.postFileForm = (url,form,callback)->
data = new FormData(form[0] or form)
return $.ajax
url: url
data:data
type:"POST"
cache: false
contentType: false
processData: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment