Parameter is not valid Exception
<p>I am try to upload image from an iPhone using a webservice but I got an Exception like -</p>

<blockquote>
  <p>{System.ArgumentException: Parameter is not valid.    at
  System.Drawing.Image.FromStream(Stream stream, Boolean
  useEmbeddedColorManagement, Boolean validateImageData)}</p>
</blockquote>

<p>in following code</p>

<pre><code>string acFolder = Server.MapPath("~/Images/");
string imgname = DateTime.UtcNow.ToString().Replace(" ", "").Replace("AM", "").Replace("PM", "").Replace("/", "").Replace("-", "").Replace(":", "") + ".jpeg";

byte[] imageBytes = Convert.FromBase64String(image.Replace(" ", "+"));
MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length);

// Convert byte[] to Image
ms.Write(imageBytes, 0, imageBytes.Length);
System.Drawing.Image image2 = System.Drawing.Image.FromStream(ms,true,true);
image2.Save(acFolder + imgname);
</code></pre>

<p>I got the exception in this line</p>

<pre><code>   System.Drawing.Image image2 = System.Drawing.Image.FromStream(ms,true,true);
</code></pre>
