File_field and Firefox


#1

Hi!
Im developing a simple prototype of an application. It fills an oracle
db with data about a file in the filesystem, and save the entire file
in a blob along with some metadata. To get the file in the db i use a
file_field form helper. All goes well with the radrails-integrated
browser, but it doesnt work anymore in firefox. The problem is,
firefox seems to cut the pathname from the file.

Here is the right hash from radrails:
“upload”=>
“C:\Documents and Settings\All Users\Documenti\Web
Development\contrattositoweb.pdf”,

Here is firefox one:
“upload”=>“contrattositoweb.pdf”

That leads at:
Errno::ENOENT in Documents#create

No such file or directory - contrattositoweb.pdf

The important part of the code is, for the view:

Content
<%= file_field 'document', 'upload' %>

and in the model document.rb:

def upload=(upload_field)
self.filename=upload_field
self.content_type=MIME::Types.type_for(upload_field)
File.open(upload_field, “rb”) { |f| #ERROR
HERE
self.filename=File.basename(upload_field)
self.content=f.read
}
end

def base_part_of(file_name)
name=File.basename(file_name)
name.gsub(/[^\w._-]/,’’)
end

As far as i know im not calling any filename-modder in the model, so
maybe the problem is in the view?

Thanks in advance for all helps…


Maurizio Marek
removed_email_address@domain.invalid


#2

http://sean.treadway.info/articles/2005/06/22/upload-progress-stabilizing
Could this help?
I don’t know what it does, but if it does an upload with firefox
successfuly
in their demo, maybe you could find what they are doing differently?


#3

I’ll check it out, thanks!

2006/2/6, anne g removed_email_address@domain.invalid:

http://sean.treadway.info/articles/2005/06/22/upload-progress-stabilizing
Could this help?
I don’t know what it does, but if it does an upload with firefox successfuly
in their demo, maybe you could find what they are doing differently?


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Maurizio Marek
removed_email_address@domain.invalid