# Specifying filesystem destination for uploaded files

**URL:** <https://www.ruby-forum.com/t/specifying-filesystem-destination-for-uploaded-files/128341>\
**Category:** Rails\
**Created:** [February 6, 2008, 10:17pm UTC](https://www.ruby-forum.com/t/specifying-filesystem-destination-for-uploaded-files/128341 "2008-02-06T22:17:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bikle](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9e8a1a/32.png) [@bikle](https://www.ruby-forum.com/u/bikle)\
**Post date:** [February 6, 2008, 10:17pm UTC](https://www.ruby-forum.com/t/specifying-filesystem-destination-for-uploaded-files/128341/1 "2008-02-06T22:17:37Z")

</div>

I saw a question on this in the archive, but no responses. Also haven’t  
been able to find much of anything via Google, so here goes.

I’ve got a workflow app built on Rails that involves checking out  
document  
files and checking them back in after local processing. This is done  
with a  
file form element, pretty standard. Some of these files can be quite  
large,  
so I am looking for ways to improve performance.

I’ve implemented one change already that has helped, namely utilizing  
File.move on the uploaded temp file, rather than reading it into memory  
and  
writing to a new file as is usually done in example code. On my  
development  
laptop this was a huge improvement.

However, on my production server, the rails app’s document storage is on  
a  
network mount, while the web server’s temp directory is of course local.  
So  
File.move has to copy the data between filesystems. It’s actually still  
faster than having Ruby read and write the files, but not as dramatic.

I’m using an Apache frontend proxied to pack-of-mongrels setup.

How can I direct mongrel to write uploaded files to a network mount?

While it may be slower then local disk, it would save time overall if  
the  
system could keep the uploaded file on the same filesystem when moving  
it  
into place.

Thanks for any info,  
Dan
