Forum: Ruby on Rails safari and firefox return different objects from a form

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7a666449acc7e18a7002bc88798a44d3?d=identicon&s=25 Jon (Guest)
on 2007-03-01 09:38
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 != """public/images/#{sanitize_filename(picture_field.original_filename)}",
"w") { |f| f.write( }

if i excersise exactly the same code in both browsers, i get different
output for the line  STDERR.puts picture_field

firefox gives me:


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?
This topic is locked and can not be replied to.