# How to make attachment\_fu work?

**URL:** <https://www.ruby-forum.com/t/how-to-make-attachment-fu-work/110414>\
**Category:** Rails\
**Created:** [July 26, 2007, 4:01am UTC](https://www.ruby-forum.com/t/how-to-make-attachment-fu-work/110414 "2007-07-26T04:01:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mister\_Yu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@Mister\_Yu](https://www.ruby-forum.com/u/Mister_Yu)\
**Post date:** [July 26, 2007, 4:01am UTC](https://www.ruby-forum.com/t/how-to-make-attachment-fu-work/110414/1 "2007-07-26T04:01:43Z")

</div>

Hi all,

I downloaded and installed attachment\_fu, also i followed mike clark’s  
tutorial from here [http://www.clarkware.com/cgi/blosxom/2007/02/24](http://www.clarkware.com/cgi/blosxom/2007/02/24)

but when i tried to upload a file, there are these error msgs:  
5 errors prohibited this photo from being saved

There were problems with the following fields:

```
* Content type is not included in the list
* Content type can't be blank
* Size is not included in the list
* Size can't be blank
* Filename can't be blank

```

actually, this has been mentioned before, but i didn’t see any  
solution.

here’s my new.rhtml:  
\<%= error\_messages\_for :photo %\>

\<% form\_for(:photo, :url  
=\>{:controller=\>“photo”, :action=\>“create”} , :html =\> { :multipart =\>  
true }) do |f| -%\>

Upload A Photo: \<%= f.file\_field :uploaded\_data %\>

\<%= submit\_tag 'Create' %\>

\<% end -%\>

and here’s the ACTUAL html file it returns:

Upload A Photo:

the “name” is actually “photo[uploaded\_data]” but not upload\_data, how  
do i fix this?

thanks.

---

<div class="post-metadata">

**Author:** ![Mister\_Yu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@Mister\_Yu](https://www.ruby-forum.com/u/Mister_Yu)\
**Post date:** [July 26, 2007, 4:51am UTC](https://www.ruby-forum.com/t/how-to-make-attachment-fu-work/110414/2 "2007-07-26T04:51:45Z")

</div>

The name “photo[uploaded\_data]” is fine, view looks fine, what does your  
controller and model look like?

You have validation errors - so what are you validating in the model?  
Your controller does not appear to be creating the object correctly  
(i.e.  
the fields aren’t getting populated), so what does it look like?

-Andrew

On 7/25/07, Mister Yu [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> There were problems with the following fields:  
> here’s my new.rhtml:  
> \<%= submit\_tag ‘Create’ %\>
> 
> >

–  
Andrew K.
