Temp-files not deleted on server when validation fails!

68 views
Skip to first unread message

Andreas

unread,
Nov 10, 2009, 9:17:37 AM11/10/09
to Paperclip Plugin
Dear Community,

when uploading a video file via paperclip, the validation failed. If
failed because of the wrong file format (that is another problem,
because it was an .flv file and the correct mime type video/x-flv is
specified in the model).

Surprisingly, the temp File of the uploaded video was still remaining
on our server. When we checked our server for more old temp files, we
noticed, that all failed to upload files were still remaining on the
server.

Is this a known problem?

Anyone, who knows a solution for this?

Many thanks so far!

Andreas

Andreas

unread,
Nov 20, 2009, 4:21:28 AM11/20/09
to Paperclip Plugin
Dear community,

no idea?

Has noone else this problem?

I just cannot believe this

Andreas

Kris Leech

unread,
Nov 20, 2009, 10:00:00 AM11/20/09
to papercli...@googlegroups.com
Since these files are in /tmp does the OS (linux?) not automatically delete them periodically?

 Kris.

Jonathan Yurek

unread,
Nov 20, 2009, 10:39:19 AM11/20/09
to papercli...@googlegroups.com
If the files are being put into the /tmp directory, then they should
have been Tempfiles, which delete themselves. Or, at least, the OS
should delete the contents of that directory occasionally. If they're
Tempfiles and didn't delete themselves, then something else is going
on. What version of Ruby are you running?
> --~--~---------~--~----~------------~-------~--~----~
> Individuals over processes. Interactions over tools.
>
> Agile Rails training from thoughtbot, the makers of Paperclip,
> Clearance, Shoulda, & Factory Girl:
> http://thoughtbot.com/services/training
>
> The Paperclip group:
> http://groups.google.com/group/paperclip-plugin
>
> To post to this group, send email to
> papercli...@googlegroups.com
>
> To unsubscribe from this group, send email to
> paperclip-plug...@googlegroups.com
> -~----------~----~----~----~------~----~------~--~---
>

--
Jonathan Yurek, Founder and CTO
thoughtbot, inc.
organic brains. digital solutions.

617.482.1300 x114
http://www.thoughtbot.com/

Andreas

unread,
Nov 23, 2009, 12:40:20 PM11/23/09
to Paperclip Plugin
Hi Jonathan, hi Kris,

yes the files are in the tmp folder of course.

But I see the following problems: The server only deletes these files
on restarting. There are several applications running live on this
server. So we do not want to restart it if not really necessary of
course.
Moreover, I would think it is the job of the uploading application (in
this case the paperclip plugin) to delete the temp files, if
validation fails. I am not too deep in programming yet, but I think
this would be the obvious way to deal with such "garbage" files.
Or is this way not possible for reasons, I just do not know yet?

We are working on a debian linux server ruby 1.8.7 (2008-08-11
patchlevel 72) [x86_64-linux].

Many thanks for discussing and answering here!!!

Andreas
Reply all
Reply to author
Forward
0 new messages