File upload works fine in FF, Crashes server in IE

I made a file upload system.

It works perfectly in Firefox, with both large and small files
(Tempfiles and StringIO) being copied into the appropriate server
directory.

The uploading works the same in IE too, for small files that have the
type of StringIO. For some reason, when I upload a large file through IE
(meaning a file large enough to be handled as a Tempfile by Ruby) the
parameter sent over is a humongous plaintext string that I can only
assume is the plaintext representation of the binary file data. This
string is very large and crashes my server.

Please help.

View (imagine it like this, there’s actually alot of javascript for the
multiple upload thing, and also file input decoration):




Controller (this is a handler for multiple files):

params[‘content’][‘uploaded_data’].each { |v|

    if v[1].to_s == ""
      next
    end

    valid = true
    # SET TO NULL_PROJECT of id 0, since we will set project id

later
content = Content.new(:project_id => 0)
content.upload_salt = salt
content.save!

     post = DataFile.save(v[1], content.content_id.to_i.to_s)
     content.content_url = post
     content.content_type = DataFile.get_type(content.content_url)
     content.original_filename =

DataFile.sanitize_filename(v[1].original_filename)
content.content_add_date = Time.now
content.save!

  }

The screenshot is of the console output when I attempted to upload a
4.5MB file through Internet Explorer

I’ve narrowed it down a bit:

IE will only pass this HUGE string when a SWF-type file is
uploaded…Everything else, big or small works…just no SWFs!!

What?!!

Please help!