Forum: Ruby on Rails Uploading files in a special path

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.
37303898ae88924da762b6a83c06f624?d=identicon&s=25 massinissa mecharek (Guest)
on 2007-04-24 10:55
i have a table "upload_files" i want to join a file when i insert e
record in the table :

    1* insert into upload_files information about the file uploaded and
who upload it  upload_files.save .....

    2*copy the file in a special path (massi/id/)

thanks
7c8f8b6eae4dd991e3a9065c68451361?d=identicon&s=25 Wai Tsang (sneptune)
on 2007-04-24 16:22
massinissa mecharek wrote:
> i have a table "upload_files" i want to join a file when i insert e
> record in the table :
>
>     1* insert into upload_files information about the file uploaded and
> who upload it  upload_files.save .....
>
>     2*copy the file in a special path (massi/id/)
>
> thanks

You may want to look into the Act_as_Attachment plugin for such task.
You would have to override the full_filename method however.
This topic is locked and can not be replied to.