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?
on 2007-03-01 09:38
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.