Upload file and insert on a database


I miss something I don't understand what?

i have form:

ho calls

    def contacts_mailer         mail = Notifier.create_contact_request(params[:contact])         Notifier.deliver(mail)         @contact = Contact.new         @contact.file_file_name=params[:contact][:file].original_filename         @contact.file_content_type=params[:contact][:file].content_type         @contact.file=params[:contact][:file].read

        @contact.save         redirect_to :action => 'contact'         #render :file => "#{RAILS_ROOT}/public/thx1.html"     end

@contact.file is a BLOB but I am not finding the file it don't get errors only a 0 byte file


where I use the same funcion Works

class Notifier < ActionMailer::Base    def contact_request(recipient)      recipients ""      from recipient[:email]      subject "Contact Request from "+recipient[:name]+", "+recipient[:company]      @body["name"] = recipient[:name]      @body["company"] = recipient[:company]      @body["address"] = recipient[:address]      @body["phone"] = recipient[:phone]      @body["email"] = recipient[:email]      @body["notes"] = recipient[:notes]      @body["file"] = recipient[:file].original_filename      part :content_type => "text/html", :body => render_message("contact_request", @body)      attachment :content_type => recipient[:file].content_type,        :body => recipient[:file].read,        :filename => recipient[:file].original_filename    end end

the mail is correct and the file is atached can anyone help me?