Send_file confusion

Anyone see where I am going wrong here?

Error = undefined method `filename=’

Model

class Upload < ActiveRecord::Base
def upload=(upload_field)
self.filename = upload_field.original_filename
self.content_type = upload_field.content_type.chomp
self.binary_data = upload_field.read
end

end

Controller

def upload
@upload = Upload.find(params[:id])
send_file(@upload.file,
:filename => @upload.name,
:type => @upload.content_type,
:disposition => “inline”)
end

Form

Upload a file:
<% form_tag({:action => 'create'}, :multipart => true) do %> <%= file_field("upload", "upload") %><%= submit_tag("Upload file") %> <% end %>

Thanks for any help.
Lynn

On Jun 17, 2008, at 14:38 , lynn wrote:

Anyone see where I am going wrong here?

you’re sending a rails-related question to the ruby list instead of
the rails list.

2008/6/17 lynn [email protected]:

   self.binary_data = upload_field.read
 end

end

I’m guessing your uploads table doesn’t have a string column called
“filename”.