# Attachment\_fu and really small files (and an extension?)

**URL:** <https://www.ruby-forum.com/t/attachment-fu-and-really-small-files-and-an-extension/126528>\
**Category:** Rails\
**Created:** [January 19, 2008, 1:37am UTC](https://www.ruby-forum.com/t/attachment-fu-and-really-small-files-and-an-extension/126528 "2008-01-19T01:37:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcampbell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@mcampbell](https://www.ruby-forum.com/u/mcampbell)\
**Post date:** [January 19, 2008, 1:37am UTC](https://www.ruby-forum.com/t/attachment-fu-and-really-small-files-and-an-extension/126528/1 "2008-01-19T01:37:16Z")

</div>

whats up guys…ive tried sifting through the archives of this forum but  
to no avail…i am using rick olson’s attachment\_fu (great stuff btw) but  
i run into problems when I have a really small file (like 20kb) and I go  
to upload it. For example, I upload a file called unrealircd.conf and i  
get the error,

“undefined method ‘content\_type’” and I see that the object is a string  
and not a file…even so, whenever i get rid of the extension (.conf) of  
the file, it uploads just fine. any ideas?

---

<div class="post-metadata">

**Author:** ![mcampbell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@mcampbell](https://www.ruby-forum.com/u/mcampbell)\
**Post date:** [January 19, 2008, 1:45am UTC](https://www.ruby-forum.com/t/attachment-fu-and-really-small-files-and-an-extension/126528/2 "2008-01-19T01:45:24Z")

</div>

Michael Cramp wrote:

> whats up guys…ive tried sifting through the archives of this forum but  
> to no avail…i am using rick olson’s attachment\_fu (great stuff btw) but  
> i run into problems when I have a really small file (like 20kb) and I go  
> to upload it. For example, I upload a file called unrealircd.conf and i  
> get the error,
> 
> “undefined method ‘content\_type’” and I see that the object is a string  
> and not a file…even so, whenever i get rid of the extension (.conf) of  
> the file, it uploads just fine. any ideas?

actually, i checked out my logs again…seems like that error is gone  
(seems to pop up randomly) but i am getting this when uploading a  
.torrent file:

ActiveRecord::RecordInvalid (Validation failed: Content type can’t be  
blank, Size is not included in the list, Size can’t be blank, Filename  
can’t be blank):

---

<div class="post-metadata">

**Author:** ![mcampbell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@mcampbell](https://www.ruby-forum.com/u/mcampbell)\
**Post date:** [January 19, 2008, 5:40am UTC](https://www.ruby-forum.com/t/attachment-fu-and-really-small-files-and-an-extension/126528/3 "2008-01-19T05:40:27Z")

</div>

I’ve had similar issues. Check your max size - sometimes it is just  
because the size of the file is too large.

---

<div class="post-metadata">

**Author:** ![mcampbell](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8e7dd6/32.png) [@mcampbell](https://www.ruby-forum.com/u/mcampbell)\
**Post date:** [January 24, 2008, 8:52pm UTC](https://www.ruby-forum.com/t/attachment-fu-and-really-small-files-and-an-extension/126528/4 "2008-01-24T20:52:23Z")

</div>

Jimmy P. wrote:

> I’ve had similar issues. Check your max size - sometimes it is just  
> because the size of the file is too large.

I have this same error:

Validation failed: Size is not included in the list

I am trying to uplaod a 12.5k animated .gif file, and my max\_size is set  
to 100.kilobytes.

So the file being too big is definately not the issue.
