Question about file_column plugin

Hi!

File_column plugin saves uploaded files to
“public/model/image/model_id/filename”, if i understand it correctly.
Does it mean that it creates new folder for every image?

I have product (model) that has_many images (model). Is it possible to
use (or modify) this plugin that it would save my images to different
folder, so the id of the model_id part would be id of the product that
the image belongs_to, not the id of the image?

On 3/6/06, g0nzo [email protected] wrote:

Hi!

File_column plugin saves uploaded files to
“public/model/image/model_id/filename”, if i understand it correctly.
Does it mean that it creates new folder for every image?

yes, because your model_id’s are unique, filenames can be duplicate

I have product (model) that has_many images (model). Is it possible to

use (or modify) this plugin that it would save my images to different
folder, so the id of the model_id part would be id of the product that
the image belongs_to, not the id of the image?

no (same reason as answer above), but what you can do is to define a
different root directory for your files if using file_column from
Subsversion trunc, if that helps …

Thanks.

I’ve found one more problem - i don’t know to use many
file_column_fields in a single form, so i’ll leave my own ugly (but
working) code for now :slight_smile:

Berin L. wrote:
g0nzo wrote:
Hi!

File_column plugin saves uploaded files to
“public/model/image/model_id/filename”, if i understand it correctly.
Does it mean that it creates new folder for every image?
When you consider that the file_upload plugin allows you to save
multiple versions of the same file for each ID, that works.
I have product (model) that has_many images (model). Is it possible to
use (or modify) this plugin that it would save my images to different
folder, so the id of the model_id part would be id of the product that
the image belongs_to, not the id of the image?

Honestly, I started playing with the file_upload plugin and then
realized that I wanted my images stored in the database–not the
filesystem. Main reason was because I wanted to make it easier to
distribute the app. When you save the images to the filesystem, you
have to set up your web app in a SAN if you want to distribute the
images and such across many servers scalably. In the database, you make
it an issue of scaling the database. More ISPs have experience doing
that than setting up SANs for your application.

I found it wasn’t hard to do, and if you are interested I’ll share how I
did it (Rails 1.0, MySQL 5)

would you please show me how to do that? Thanks!

g0nzo wrote:

Hi!

File_column plugin saves uploaded files to
“public/model/image/model_id/filename”, if i understand it correctly.
Does it mean that it creates new folder for every image?

When you consider that the file_upload plugin allows you to save
multiple versions of the same file for each ID, that works.

I have product (model) that has_many images (model). Is it possible to
use (or modify) this plugin that it would save my images to different
folder, so the id of the model_id part would be id of the product that
the image belongs_to, not the id of the image?

Honestly, I started playing with the file_upload plugin and then
realized that I wanted my images stored in the database–not the
filesystem. Main reason was because I wanted to make it easier to
distribute the app. When you save the images to the filesystem, you
have to set up your web app in a SAN if you want to distribute the
images and such across many servers scalably. In the database, you make
it an issue of scaling the database. More ISPs have experience doing
that than setting up SANs for your application.

I found it wasn’t hard to do, and if you are interested I’ll share how I
did it (Rails 1.0, MySQL 5)

I’m also interested in this could you please send me the info.
On 6-Mar-06, at 9:51 PM, nina zhang wrote:

use (or modify) this plugin that it would save my images to different
it an issue of scaling the database. More ISPs have experience doing


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Peter W.
[email protected]