Flash 8 Player on Windows sends a POST request with CONTENT_LENGTH = 0 if the file you are uploading using the new Flash 8 FileReference mechanism is greater than 10K. Rails fails (correctly), but this causes the next request to also crash and we never get the file uploaded by flash.
There is a simple fix for this:
Just add the following line to if statement that appears on line 5 or 6 of actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb
&& (Integer(env_table['CONTENT_LENGTH']) > 0)
So, the OLD version is:
if boundary = multipart_form_boundary
@multipart = true
@params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
else...
the NEW version is:
if boundary = multipart_form_boundary && (Integer(env_table['CONTENT_LENGTH']) > 0)
@multipart = true
@params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
else...
In the latest trunk code, the new code becomes:
if method == :post && (boundary = multipart_form_boundary) && (Integer(env_table['CONTENT_LENGTH']) > 0)
@multipart = true
@params = read_multipart(boundary, Integer(env_table['CONTENT_LENGTH']))
else...