2008/6/17 lynn <lynnlobash / yahoo.com>:
> 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

I'm guessing your uploads table doesn't have a string column called "filename".

>
> Controller
>
> def upload
>    @upload = Upload.find(params[:id])
>    send_file(@upload.file,
>      :filename => @upload.name,
>      :type => @upload.content_type,
>      :disposition => "inline")
>  end
>
> Form
>
> <div id="UploadFileBox">
> <b>Upload a file:<br/></b>
> <% form_tag({:action => 'create'}, :multipart => true) do %>
> <%= file_field("upload", "upload") %><%= submit_tag("Upload file") %>
> <% end %>
>
> Thanks for any help.
> Lynn
>
>



-- 
JJ