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? -- Posted via http://www.ruby-forum.com/.
On 3/6/06, g0nzo <g0nzo@o2.pl> 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 .. --> Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Roberto Saccon - http://rsaccon.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060306/f88d4f62/attachment.html
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 :) -- Posted via http://www.ruby-forum.com/.
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)
Berin Loritsch 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! -- Posted via http://www.ruby-forum.com/.
I''m also interested in this could you please send me the info. On 6-Mar-06, at 9:51 PM, nina zhang wrote:> Berin Loritsch 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! > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsPeter Woolcock peter@cosmicfrontier.ca