KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jan-01 18:30 UTC
How do we decide location of our photos in attachment _fu for Windows XP?
Simply put: I don''t understand the reasoning behind where photos are stored in the :file_system option of attachment_fu? has_attachment :content_type => :image, :storage => :file_system, :max_size => 2.megabytes, :resize_to => ''320x200>'', :thumbnails => { :thumb => ''100x100'' }, :processor => ''rmagick'' validates_as_attachment def full_filename(thumbnail = nil) file_system_path = (thumbnail ? thumbnail_class :self).attachment_options[:path_prefix].to_s File.join(RAILS_ROOT, file_system_path, thumbnail_name_for(thumbnail)) end For some ''magical'' reason this worked fine with my Rails 1.2.6 source code and now it objects. I am certain that the problem resides in WHERE Windows XP tries to save the photo. I know this because I changed the :storage value to S3 and the code went through (although using Windows XP the image is not viewable using this plugin do to some type of operating system anomoly?). Anyway, how do you guys declare your "full_filename(thumbnail) path and what is the significance of this? The error message I get with Windows XP is: {"media_id"=>"6", "commit"=>"Save Photo", "mediaphoto"=>{"title"=>"Test photo", "uploaded_data"=>#<File:c:/temp/CGI2532-5>, CGI4076-5>, "geo_long"=>"0.0", "show_geo"=>"1", "geo_lat"=>"0.0"}} I seem to recall months ago that there was a problem as Windows mixes forward slashes with backward slashes??? I want the uploaded data to put itself in the \mediaphoto\"goes here" folder. Thank you, Kathleen KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Zhurbiy Oleg
2008-Jan-01 21:19 UTC
Re: How do we decide location of our photos in attachment _fu for Windows XP?
it`s described by :path_prefix param or default has_attachment :storage => :file_system, :path_prefix => ''public/pictures/avatar/blogs'', i`m testing the proj on XP and it work fine KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org:> Simply put: I don''t understand the reasoning behind where photos are > stored in the :file_system option of attachment_fu? > > has_attachment :content_type => :image, > :storage => :file_system, > :max_size => 2.megabytes, > :resize_to => ''320x200>'', > :thumbnails => { :thumb => ''100x100'' }, > :processor => ''rmagick''--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
fredistic
2008-Jan-01 21:22 UTC
Re: How do we decide location of our photos in attachment _fu for Windows XP?
You can override the full_filename method by coding it in your model. Copy the source from attachment_fu.rb into your model and hack away. f --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---