Wierd problem with attachment_fu plugin?

I’m using the attachment_fu plugin in the following manner to upload a
file.
http://khamsouk.souvanlasy.com/2007/5/1/ajax-file-uploads-in-rails-using-attachment_fu-and-responds_to_parent

I ge tthe following error if I upload a file that’s over 1K or so. It
works fine for small files (500 bytes or so):

1 error prohibited this raw data file from being saved
There were problems with the following fields:
  * Size is not included in the list

This is using the POST action in the scaffold_resource generated
controller

Chirag

POST /raw_data_files

POST /raw_data_files.xml

def create
@raw_data_file = RawDataFile.new(params[:raw_data_file])

respond_to do |format|
  if @raw_data_file.save
    flash[:notice] = 'RawDataFile was successfully created.'
    format.html { redirect_to raw_data_file_url(@raw_data_file) }
    format.xml  { head :created, :location =>

raw_data_file_url(@raw_data_file) }
else
format.html { render :action => “new” }
format.xml { render :xml => @raw_data_file.errors.to_xml }
end
end
end

On 6/26/07, chirag [email protected] wrote:

There were problems with the following fields:
  * Size is not included in the list

That’s a validation error. Either you set your min/max values
incorrectly, or you don’t have rmagick/imagescience/minimagick so that
attachment_fu can set the correct size.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

I changed the following line in the model from

:max_size => 2.megabytes

to
:size => 0.megabyte…2.megabytes

and it worked. Thanks rick!