public
Created

jquery-upchunk's send function

  • Download Gist
send.coffee
CoffeeScript
1 2 3 4 5 6
send = (chunk, url) =>
fd = new FormData
fd.append(@opts.file_param, chunk)
xhr = new XMLHttpRequest
xhr.open('POST', url, true)
xhr.send(fd)
upload.rb
Ruby
1 2 3
File.open('/tmp/' + current_user.lowname + '_' + params[:hash], 'a') do |upload|
upload.write(File.read(params[:file].tempfile))
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.