Forum: Ruby on Rails file_column problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3891cd3dea8160419f6f48054f3a08e5?d=identicon&s=25 Andrew VanSpronsen (Guest)
on 2005-12-13 14:34
(Received via mailing list)
Hello all,

I get the message below when I try to use the file_column plugin in my
app to upload files.  I have followed the instructions on the
file_column website and the RoR rails wiki with no luck.  Any ideas?

I would be happy to provide more details wrt my controller, view,
model, etc should they be required! I am not doing anything crazy
though so I think I am just overlooking something.



Error:
Do not know how to handle a string with value 'misc.jpg' that was
passed to a file_column. Check if the form's encoding has been set to
'multipart/form-data'.


Thanks in advance!

Andrew
--
3d333b0012928f3dd5a6861cb09ad683?d=identicon&s=25 Kris Leech (krisleech)
on 2005-12-13 16:05
Your form needs to be rendered as multipart because it is handling
binary data (the file being upload).

In the view which displays the form with the file upload add ":multipart
=> true", as an example:

<%= start_form_tag({:action=>'update', :id => @category}, :multipart =>
true)%>


hope that helps, Kris.


Andrew VanSpronsen wrote:
> Hello all,
>
> I get the message below when I try to use the file_column plugin in my
> app to upload files.  I have followed the instructions on the
> file_column website and the RoR rails wiki with no luck.  Any ideas?
>
> I would be happy to provide more details wrt my controller, view,
> model, etc should they be required! I am not doing anything crazy
> though so I think I am just overlooking something.
>
>
>
> Error:
> Do not know how to handle a string with value 'misc.jpg' that was
> passed to a file_column. Check if the form's encoding has been set to
> 'multipart/form-data'.
>
>
> Thanks in advance!
>
> Andrew
> --
3891cd3dea8160419f6f48054f3a08e5?d=identicon&s=25 Andrew VanSpronsen (Guest)
on 2005-12-13 17:14
(Received via mailing list)
Perfect!  I had that statement but not with the brackets as you did.
Thanks
so much!

Andrew

On 12/13/05, Kris Leech <krisleech@interkonect.com> wrote:
>
> > I would be happy to provide more details wrt my controller, view,
> >
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>



--
This topic is locked and can not be replied to.