Hi, been having problems with my image uploads with Safari and firefox,
i get it working with one, and it brakes in the other, and vice versa.
This problem manifests itself during an edit, if no image is selected on
the form.
I have the following code in my model:
  def main_picture=(picture_field)
    STDERR.puts picture_field
    if picture_field != ""
     
File.open("public/images/#{sanitize_filename(picture_field.original_filename)}",
"w") { |f| f.write(picture_field.read) }
    end
  end
if i excersise exactly the same code in both browsers, i get different
output for the line  STDERR.puts picture_field
firefox gives me:
#<StringIO:0x256860c>
safari gives me a blank line. It also gives me the error:
undefined method `original_filename'' for "":String
It seems that firefox correctly returns a picture object, but safari
returns a blank string.
Any ideas?
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---