How to set cgi temp directory for uploads?

Hi all,
my application has some very large file uploads, up to around 200MB.
This
eats up all my /tmp space (1 Gig) and so the upload fails. I get this
message: No space left on device - /tmp/CGI16004-2

Is there a way to configure rails (or cgi.rb, as the case may be) to use
a
different tmp directory for file uploads?

Thanks,
Sean

I am using act_as_attachment

in Model I have this :

has_attachment :storage => :file_system,
:resize_to => [300,185],
:thumbnails => { :thumb => [84,60]},
:size => 0.megabyte…300.megabytes,
:content_type => :image,
:path_prefix => ‘public/images/package’,
:processor => ‘Rmagick’
validates_as_attachment

reinhart
http://teapoci.blogspot.com

On Apr 30, 6:59 am, “Sean O’Hara” [email protected] wrote:

Hi all,
my application has some very large file uploads, up to around 200MB. This
eats up all my /tmp space (1 Gig) and so the upload fails. I get this
message: No space left on device - /tmp/CGI16004-2

Is there a way to configure rails (or cgi.rb, as the case may be) to use a
different tmp directory for file uploads?

I think I am correct in saying that it all funnels through
http://www.ruby-doc.org/core/classes/Dir.src/M002349.html which
suggests that setting one of those environment variables will do the
trick.

Fred

On 30 Apr 2008, at 14:02, Sean O’Hara wrote:

Thanks for the suggestion. How would I set the environment variables
for rails, or mongrel?

You could just set ENV[‘Foo’]=‘bar’ in your environment.rb file.

Fred

Thanks! That seemed to work (console now says /var/tmp for Dir::tmpdir).
Just have to wait for the long upload to complete to see how it is
handled.
take care,
sean

On Wed, Apr 30, 2008 at 9:41 AM, Frederick C. <

Thanks for the suggestion. How would I set the environment variables for
rails, or mongrel?
Sean

On Wed, Apr 30, 2008 at 4:12 AM, Frederick C. <

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs