See FILE UPLOAD WITH SINATRA at http://www.wooptoot.com/file-upload-with-sinatra