I use this with one of my rails 3 applications:
= form_for :import_csv, :url => {:action => :import_csv}, :html => {:multipart => true} do |f|
= f.file_field :csv
= f.submit 'Upload CSV'
Creates a temporary file that can be obtained using
CSV.open(params[:import_csv][:csv].tempfile.path)
I see no reason why this could not be expanded to several downloads, and gain access to params[:import_csv][:whatever]
Note ** handling of tempfiles has changed a bit in rails 3.0.3, so it is used in the above code .tempfile.path, which is not required in previous versions.
source
share