Forum: Ruby on Rails file_column and tmp files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
John T. (Guest)
on 2006-01-22 23:02
Hi again...

One more item.. the file_column plugin uses a tmp directory inside the
/public directory to store a temporary uploaded item. But it looks like
this folder is just going to grow and grow. Is there some way to clear
this out or not cause this to happen?

Thanks once again!
John T. (Guest)
on 2006-01-22 23:10
John T. wrote:
> Hi again...
>
> One more item.. the file_column plugin uses a tmp directory inside the
> /public directory to store a temporary uploaded item. But it looks like
> this folder is just going to grow and grow. Is there some way to clear
> this out or not cause this to happen?
>
> Thanks once again!

Well, I know why the tmp files are building up - they are the ones that
are not removed when the other error I posted about happens. It seems
file_column is moving the file into it's proper place, or trying to, and
when the error occurs ('same file' - having to do with the case of the
file), the file in the tmp directory is not removed.

Now I know why, but still don't know how to fix it ;)

jt
Sebastian K. (Guest)
on 2006-01-22 23:57
(Received via mailing list)
On 1/22/06, John T. <removed_email_address@domain.invalid> wrote:
> Well, I know why the tmp files are building up - they are the ones that
> are not removed when the other error I posted about happens. It seems
> file_column is moving the file into it's proper place, or trying to, and
> when the error occurs ('same file' - having to do with the case of the
> file), the file in the tmp directory is not removed.

basically, the tmp files are removed once the model is saved without
errors. Before this, file_column can't remove them, because they might
be needed for a form that is redisplayed because of validation errors.

The idea is to use a cron-job that deletes all files in the tmp
directory that are older than 24 hours or so. Right now, you have to
write this yourself (should be trivial), but patches are welcome...

Sebastian
John T. (Guest)
on 2006-01-23 00:24
Sebastian K. wrote:
> On 1/22/06, John T. <removed_email_address@domain.invalid> wrote:
>> Well, I know why the tmp files are building up - they are the ones that
>> are not removed when the other error I posted about happens. It seems
>> file_column is moving the file into it's proper place, or trying to, and
>> when the error occurs ('same file' - having to do with the case of the
>> file), the file in the tmp directory is not removed.
>
> basically, the tmp files are removed once the model is saved without
> errors. Before this, file_column can't remove them, because they might
> be needed for a form that is redisplayed because of validation errors.

Yeah, I did figure that out. Unfortunately, with the problem with the
file case (at least on OS X), I can't upload a file with an upper case
name/extension.

Thanks.
This topic is locked and can not be replied to.