Hi - Can someone explain how/why attachment_fu stores its files the way it does? I noticed that it creates a directory for each upload and am curious how it determines this and/or the methodology. Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 23 Jul 2008, at 13:02, MW Administrator wrote:> Can someone explain how/why attachment_fu stores its files the way it > does? I noticed that it creates a directory for each upload and am > curious how it determines this and/or the methodology.It creates a directory for each model you define with "has_attachment" within the public folder (although you can change the storage path if you want to). Then it creates partitioned folders by default based on the id of your model record (this can disabled if you want to). For record with id=1 in your Document model, it will create documents/ 0000/0001/file.ext. The reason why it partitions the folders has to do with filesystem limits iirc. Some storage systems have a limit to the number of folders within a directory. The best thing to do, is just browse through the source code (or rdoc) of the plugin yourself, it''s well documented and tells you all you need to know. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you - this makes sense and re-assures some speculations. Peter De Berdt wrote:> > On 23 Jul 2008, at 13:02, MW Administrator wrote: > >> Can someone explain how/why attachment_fu stores its files the way it >> does? I noticed that it creates a directory for each upload and am >> curious how it determines this and/or the methodology. > > It creates a directory for each model you define with "has_attachment" > within the public folder (although you can change the storage path if > you want to). Then it creates partitioned folders by default based on > the id of your model record (this can disabled if you want to). For > record with id=1 in your Document model, it will create > documents/0000/0001/file.ext. The reason why it partitions the folders > has to do with filesystem limits iirc. Some storage systems have a limit > to the number of folders within a directory. > > The best thing to do, is just browse through the source code (or rdoc) > of the plugin yourself, it''s well documented and tells you all you need > to know. > > > Best regards > > > Peter De Berdt > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---