Project

tupper

0.0
No commit activity in last 3 years
No release in over 3 years
Tupper is a helper for processing uploaded file via web form.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
 Project Readme

Tupper

Circle CI

Tupper is a helper for processing uploaded file via web form.

Installation

Add this line to your application's Gemfile:

gem 'tupper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tupper

Usage

usage on Sinatra application:

upload

post '/upload' do
  tupper = Tupper.new session
  tupper.upload params[:file_from_form]
  redirect '/somewhere', 302
end

process uploaded file

get '/show_file_info' do
  tupper = Tupper.new session
  if tupper.has_uploaded_file?
    filename = tupper.uploaded_file
    # do something
  end
  erb :show_file_info, locals: { tupper: tupper }
end

cleanup uploaded file and session

post '/cleanup' do
  tupper = Tupper.new session
  tupper.cleanup
  redirect '/', 302
end

more info

see /sample