I''m running Mongrel (and the same thing happens in Webrick mode).
I''m uploading a file via form, and I''m getting the following
error:
Error calling Dispatcher.dispatch #<EOFError: bad content body>
/usr/local/lib/ruby/1.8/cgi.rb:984:in `read_multipart''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_controller/cgi_ext/raw_post_data_fix.rb:38:in
`initialize_query''
I''m able to upload files fine from other forms in the site, but when I
upload on a specific page, I get that error.
Here is the generated html source for the upload form:
<form
action="/admin/cl_master/ajax_like_approve_with_alternate/752"
enctype="multipart/form-data" method="post"
target="frame">
<input id="_752_field" name="[752_field]"
size="10" type="file" />
<div id="752_awa_button_container">
<input id="752_awa_button"
onclick="PreFormSubmit(this.form, ''awa'',
752);" type="button" value="Approve" />
</div>
</form>
"frame" is an iframe, but I get the same error posting without the
target designation.
The action in the controller does nothing:
def ajax_like_approve_with_alternate
# Do stuff with params[:uploaded_file]
#data = ClData.find( params[:id] )
#responds_to_parent do
# render :update do |page|
# page << "ResponseHandler( #{params[:id]},
''awa'', 1 )"
# end
#end
end
The only difference I can see between other pages on the site is that
other pages don''t specify a target for the form (which again,
doesn''t
help the problem), and the page that is causing the errors has many
forms on it (NOTE: I''ve checked to be sure none of them are embedded
within another).
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---