0

I want to change tmpdir of fileupload on each user sessions with Rubu on Rails.

For example:

UserA's upload tmpdir /home/userA/tmp

UserB's upload tmpdir /home/userB/tmp

Is it possible to do it on Ruby On Rails?

  • I found perser.rb has a code to create Tempfile when uploading. body = Tempfile.new("RackMultipart") but How can I tell him a new tmpdir? – user3553823 Apr 22 '14 at 08:18
  • I found a solution myself. override get_current_head_and_filename_and_content_type_and_name_and_body method and post 'tmpdir' values when POST files. `pm = @params.to_params_hash` `body = Tempfile.new("RackMultipart", pm['tmpdir'])` – user3553823 Apr 23 '14 at 13:30

0 Answers0