How to fix ticket #6401 (multipart forms)?

Hi,

I need some ideas for fixing ticket #6401 (http://dev.rubyonrails.org/ticket/6401).

The problem: All form fields become StringIOs when a multipart form is submitted with Lynx or NN 4.x.

Reason: these browsers send a "content-type: text/plain" header for each form field, and Rails uses the existance of the content-type header to distinguish between normal fields and file uploads (line 69 in actionpack/lib/action_controller/cgi_ext/cgi_methods.rb):

  elsif value.respond_to?(:content_type) && ! value.content_type.blank?     # Uploaded file

How could we fix that? Is it sufficient to check if there is a filename given (respond_to?(:original_filename) && !value.original_filename.blank?), or are there some cases where this would fail?

Andreas