Saving multiple files
<p>I have the following code:</p>

<pre><code>    [HttpPost]
    public ActionResult FileUploadMultiple(IEnumerable&lt;HttpPostedFileBase&gt; files)
    {

        foreach (var file in files)
        {
            if (file != null)
            {
                var fileName = Path.GetFileName(file.FileName);
                string extension = Path.GetExtension(file.FileName);

                var path = Path.Combine("C://Reports//36000", fileName);

                file.SaveAs(path);

            }

        }

        return RedirectToAction("Index");
    }
</code></pre>

<p>I have 2 files that I am testing on - as such it should loop twice. The first saves fine to the given path. When the code goes and tries to do the second file, I get the following message:</p>

<p><em>The process cannot access the file 'C:\Reports\36000\Report #36028.pdf' because it is being used by another process.</em></p>

<p>I think I need to do a dispose but, when I tried to do <code>file.Dispose()</code> this didn't appear to be correct in <code>Intellisense</code>.</p>
