views:

45

answers:

1

I have a bunch of files in the server and I want to link them to a model with paperclip, since I want to generate the thumbnails and save their info in the database, just as if I uploaded with a form.

Is it possible to use a console command passing the file paths for generating the Paperclip Model?

+2  A: 

There is a rake task that shows how to accomplish what you want to do using fixtures. It should be easy to adapt to your needs.

It looks to be as simple as setting the file on your model to the full path to the file, and calling reprocess! See the link for full details

Jeff Paquette
It works with images but not with video files. @_@
Erik Escobedo