# Wierd problem with attachment\_fu plugin?

**URL:** <https://www.ruby-forum.com/t/wierd-problem-with-attachment-fu-plugin/107889>\
**Category:** Rails\
**Created:** [June 27, 2007, 5:56am UTC](https://www.ruby-forum.com/t/wierd-problem-with-attachment-fu-plugin/107889 "2007-06-27T05:56:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chirag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chirag](https://www.ruby-forum.com/u/chirag)\
**Post date:** [June 27, 2007, 5:56am UTC](https://www.ruby-forum.com/t/wierd-problem-with-attachment-fu-plugin/107889/1 "2007-06-27T05:56:12Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![chirag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chirag](https://www.ruby-forum.com/u/chirag)\
**Post date:** [June 27, 2007, 8:26am UTC](https://www.ruby-forum.com/t/wierd-problem-with-attachment-fu-plugin/107889/2 "2007-06-27T08:26:21Z")

</div>

On 6/26/07, chirag [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![chirag](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecccb3/32.png) [@chirag](https://www.ruby-forum.com/u/chirag)\
**Post date:** [June 27, 2007, 10:29pm UTC](https://www.ruby-forum.com/t/wierd-problem-with-attachment-fu-plugin/107889/3 "2007-06-27T22:29:54Z")

</div>

I changed the following line in the model from

:max\_size =\> 2.megabytes

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

and it worked. Thanks rick!
