post :index do #determine the querystring which is NOT restful and route to approriate view #URL looks like this http://localhost/app?create&id=10 url = env['REQUEST_URI'] uri = Addressable::URI.parse(url).query_values.to_hash #Provide Server Info text per spec if uri.has_key?("create") tmp_dir = File.join(Padrino.root, 'tmp') raw_data = request.body.read.force_encoding('UTF-8') file_name = File.join(tmp_dir, params[:docId]) # #save out file File.open("#{file_name}.pdf", 'w') do |f| f.write(raw_data) status 200 end end # File.open("#{file_name}-params.txt", 'w') do |f| # f.write(params.to_s) end