title: Saving multiple images in c#
body: <p>I am trying to save multiple image using this code. But instead its saving all the files including video,thumbnail and image. All i need to do is to save the images only. What am I doing wrong here? Thanks</p>
  
  <pre><code>    List&lt;string&gt; img = new List&lt;string&gt;();
                  HttpFileCollection httpFileCollection = Request.Files;
                  for (int i = 0; i &lt; httpFileCollection.Count; i++)
                  {
                      HttpPostedFile httpPostedFile = httpFileCollection[i];
                      if (httpPostedFile.ContentLength &gt; 0  &amp;&amp; httpPostedFile.ContentType.StartsWith("image/"))
                      {
                          httpPostedFile.SaveAs(Server.MapPath("~/Icon/") + System.IO.Path.GetFileName(httpPostedFile.FileName));
                          img.Add(Server.MapPath("~/Icon/") + System.IO.Path.GetFileName(httpPostedFile.FileName));
                      }
                      
                  }
  
  cmd.Parameters.AddWithValue("@ImageURL", img.ToArray().Length &gt; 0 ? String.Join(",", img.ToArray()) : Path.GetFileName(FileUpload2.PostedFile.FileName));
  </code></pre>