title: Image.FromStream(PostedFile.InputStream) Fails. (Parameter is not valid.) (AsyncFileUpload))
body: <p>I'm using an AsyncFileUpload (AJAX Toolkit) to upload images.
  I have a Button which handle the image resizing.
  This have worked fine for some time, but not anymore...</p>
  
  <pre><code>protected void BtnUploadImage_Click(object sender, EventArgs e)
  {
      var imageFileNameRegEx = new Regex(@"(.*?)\.(jpg|jpeg|png|gif)$", 
          RegexOptions.IgnoreCase);
      if (!AsyncFileUpload1.HasFile || 
          !imageFileNameRegEx.IsMatch(AsyncFileUpload1.FileName))
      {
          AsyncFileUpload1.FailedValidation = true;
          ErrorLabel.Visible = true;
          return;
      }
      ErrorLabel.Visible = false;
  
      var file = AsyncFileUpload1.PostedFile.InputStream;
  
      var img = Image.FromStream(file, false, false);
  
  ...
  }
  </code></pre>
  
  <p>Another thing which I find weird: If I try a image which is smaller than 80kb it works..!</p>
  
  <p>We have tried to restart the server, but no change.
  Same code runs fine on my machine. (heard that before ?? :) )</p>
  
  <p>I also tried to save the file on the server, then to get the file trough Image.FromFile(), but then I get "Cannot access a closed file."</p>
  
  <p>How to resolve this ?</p>