Skip to content

Instantly share code, notes, and snippets.

@Phrogz
Created May 1, 2010 21:11
Show Gist options
  • Save Phrogz/386661 to your computer and use it in GitHub Desktop.
Save Phrogz/386661 to your computer and use it in GitHub Desktop.
require 'sinatra'
get '/' do
haml :upload
end
post '/show' do
@sinatra_params = params
@rack_request = request
haml :results
end
__END__
@@ layout
!!! 5
%html
%head
%body
= yield
@@ upload
%form(method='post' action='/show' enctype='multipart/form-data')
%p
%input(type='file' name='uploads' multiple='multiple')
%p
%button(type='submit') upload
@@ results
%h1 Results
%h2 Sinatra Params
= Rack::Utils.escape_html( @sinatra_params.inspect )
%hr
%h2 Rack Request
= Rack::Utils.escape_html( @rack_request.inspect )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment