# File\_column : \_temp field always nil

**URL:** <https://www.ruby-forum.com/t/file-column-temp-field-always-nil/59370>\
**Category:** Rails\
**Created:** [May 3, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/file-column-temp-field-always-nil/59370 "2006-05-03T18:59:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [May 3, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/file-column-temp-field-always-nil/59370/1 "2006-05-03T18:59:01Z")

</div>

Hi,  
I’m trying to set up file\_column to upload attachments for emails. My  
view has

\<%= file\_column\_field ‘to\_do’, ‘attachment’  
%\> and the attachment\_temp hidden field is generated. When I  
inspect tthe params on saving the form the attachment\_temp param is  
always an empty string. Also, when I was setting this up I got a no  
method error attachment\_temp on save and had to (temporarily I hope) add  
that field to the table. The to\_do model has ‘file\_column :attachment’  
On save, the attachment field is updated with the correct file name but  
no upload takes place. I’m just not seeing why the \_temp field is not  
gwtting a value. Any clues?  
TIA,  
Eric.

---

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [May 3, 2006, 6:59pm UTC](https://www.ruby-forum.com/t/file-column-temp-field-always-nil/59370/2 "2006-05-03T18:59:28Z")

</div>

your form properbly misses multipart encoding ala

---

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [May 3, 2006, 7:05pm UTC](https://www.ruby-forum.com/t/file-column-temp-field-always-nil/59370/3 "2006-05-03T19:05:27Z")

</div>

Hi Brian,  
Thanks for the response. I have  
\<%= start\_form\_tag :controller =\> ‘to\_dos’, :action =\> ‘add\_to\_dos’, :id  
=\> @job, :multipart =\> true %\>  
in my view which is generating

 - but I still get an error re: Check if the form's encoding has been set to 'multipart/form-data'. Can you see anything wrong here? Cheers, Eric.

---

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [May 3, 2006, 7:05pm UTC](https://www.ruby-forum.com/t/file-column-temp-field-always-nil/59370/4 "2006-05-03T19:05:33Z")

</div>

Hi,  
Have solved my own dumb problem - I shoulda been putting braces around  
my url\_for\_options and options when I added the multipart statement.  
Sorry to be a nuisance  
Cheers,  
Eric.
