1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
%h1 Sinatra File Upload - if @flash = @flash %form{:action => '/upload', :method => 'post', :enctype => 'multipart/form-data'} %p< %input{:type => 'file', :name => 'file'} %p< %input{:type => 'submit', :value => 'Upload'} %h3 Files %ul - @files.each do |file| %li= "<a href='files/#{file}'>#{file}</a>"