title: Valums Ajax File Upload works in IE but not in Firefox
body: <p>I'm developing in ASP.NET MVC3 and I have the the code below for saving the file in Sql Server 2008, it works well for IE (I used IE9) but in Firefox I get the error "Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index", how should i fix this? thanks </p>
  
  <pre><code>[HttpPost]
      public ActionResult FileUpload(string qqfile)
      {
          try
          {
              HttpPostedFileBase postedFile = Request.Files[0];
              var stream = postedFile.InputStream;
              App_MessageAttachment NewAttachment = new App_MessageAttachment
              {
                  FileName = postedFile.FileName.ToString().Substring(postedFile.FileName.ToString().LastIndexOf('\\') + 1),
                  FilteContentType = postedFile.ContentType,
                  MessageId = 4,
                  FileData = new byte[postedFile.ContentLength]
              };
              postedFile.InputStream.Read(NewAttachment.FileData, 0, postedFile.ContentLength);
              db.App_MessageAttachments.InsertOnSubmit(NewAttachment);
              db.SubmitChanges();
          }
          catch (Exception ex)
          {
              return Json(new { success = false, message = ex.Message }, "application/json");
          }
          return Json(new { success = true }, "text/html");
      }
  </code></pre>