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 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

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

Sean

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