# File upload works fine in FF, Crashes server in IE

**URL:** <https://www.ruby-forum.com/t/file-upload-works-fine-in-ff-crashes-server-in-ie/126284>\
**Category:** Ruby\
**Created:** [January 16, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/file-upload-works-fine-in-ff-crashes-server-in-ie/126284 "2008-01-16T23:43:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sinaiman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@sinaiman](https://www.ruby-forum.com/u/sinaiman)\
**Post date:** [January 16, 2008, 11:43pm UTC](https://www.ruby-forum.com/t/file-upload-works-fine-in-ff-crashes-server-in-ie/126284/1 "2008-01-16T23:43:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sinaiman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@sinaiman](https://www.ruby-forum.com/u/sinaiman)\
**Post date:** [January 17, 2008, 4:53pm UTC](https://www.ruby-forum.com/t/file-upload-works-fine-in-ff-crashes-server-in-ie/126284/2 "2008-01-17T16:53:03Z")

</div>

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!
