Tino_B
March 28, 2007, 2:13pm
1
Hi,
i started to test attachment_fu, but i can’t get it to upload a file.
See
the error:
NoMethodError (undefined method content_type' for "/100_2261.jpg":String): /vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:244:in
uploaded_data=’
I looked at the plugin code, but can’t figure out how to fix this issue.
I’d
appreciate any help.
Bye,
Tino
Tino_B
March 28, 2007, 2:17pm
2
On 3/28/07, Tino B. [email protected] wrote:
I looked at the plugin code, but can’t figure out how to fix this issue. I’d
appreciate any help.
Your form needs to be a multipart form. Use :multipart => true.
http://rails.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000601
–
Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com
Tino_B
March 28, 2007, 2:35pm
3
I use the following form snippet:
form_remote_for(:image, :url => images_path, :html => {:multipart =>
true} ,
:update => “image”) do |f|
And it is compiled to a multipart form as far as i see in my html code.
Tino_B
March 28, 2007, 8:37pm
4
He, now it’s working. Thank you Raja. For the first contact with
attachment_fu I will avoid using AJAX forms for such a scenario.
Tino
Tino_B
March 28, 2007, 7:51pm
5
You can’t use AJAX forms (form_remote_for uses a for file upload
calls a XMLHttpRequest via the prototype js lib) with file uploads.
Alternate methods for inline uploads utilize hidden forms.
raja