Skip to content

Instantly share code, notes, and snippets.

@bsingr
Created May 7, 2010 08:39
Show Gist options
  • Save bsingr/393198 to your computer and use it in GitHub Desktop.
Save bsingr/393198 to your computer and use it in GitHub Desktop.
# the actual used upload called from zeus
post '/upload/:filename' do
deployed = false
begin
filename = File.join(YFILES_GRAPH_DIR, params[:filename])
File.open(filename, "wb") do |f|
while line = request.body.gets
f.write(line)
end
end
deployed = true
puts "WRITING >> " + YFILES_GRAPH_DIR + params[:filename]
rescue Exception => e
puts e.inspect
puts e.backtrace
end
content_type :json
{:deployed => deployed}.to_json
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment