KathysKode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Dec-31 16:20 UTC
How do we locate our attachment_fu photos in 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? The error message I get with Windows XP is: {"media_id"=>"6", "commit"=>"Save Photo", "mediaphoto"=>{"title"=>"Test photo", "uploaded_data"=>#<File:C:/DOCUME~1/DAVIDK~1/LOCALS~1/Temp/ 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 -~----------~----~----~----~------~----~------~--~---