# File field becomes String

**URL:** <https://www.ruby-forum.com/t/file-field-becomes-string/147332>\
**Category:** Rails\
**Created:** [August 31, 2008, 12:28pm UTC](https://www.ruby-forum.com/t/file-field-becomes-string/147332 "2008-08-31T12:28:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 31, 2008, 12:28pm UTC](https://www.ruby-forum.com/t/file-field-becomes-string/147332/1 "2008-08-31T12:28:33Z")

</div>

I have a file\_field that works fine when sending up a file. But when  
making an update the same field behaves like a String, and consequently  
the params[:file][:attachment].content\_type fails. Why is this?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [August 31, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/file-field-becomes-string/147332/2 "2008-08-31T23:52:12Z")

</div>

PÃ¥l BergstrÃ¶m wrote:

> I have a file\_field that works fine when sending up a file. But when  
> making an update the same field behaves like a String, and consequently  
> the params[:file][:attachment].content\_type fails. Why is this?

Because I missed :multipart =\> true 🙂
