title: Image/Jpeg Base 64 to Image
body: <p>I have image/jped base64 code like this,</p>
  
  <pre><code>data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAA......
  </code></pre>
  
  <p>I need, convert to image this code and save file as jpeg file. And I figured the Windows Form (C#). Insert to Textbox and button. Insert the base 64 code (the code is above) in textbox and click the button.</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          if (!string.IsNullOrEmpty(textBox1.Text))
          {
              string imageDataParsed = textBox1.Text.Substring(textBox1.Text.IndexOf(',') + 1);
              byte[] imageBytes = Convert.FromBase64String(imageDataParsed);
  
              MemoryStream ms1 = new MemoryStream(imageBytes);
              Image img = Image.FromStream(ms1);
              img.Save(Application.StartupPath + "\\Images\\1.jpg", ImageFormat.Jpeg);
          }
      }
  </code></pre>
  
  <p>File save as a jpeg. But this file seems like this on Windows Photo Viewer
  <img src="https://i.stack.imgur.com/RSzrF.png" alt="enter image description here"></p>
  
  <p>But when I run on the Google Chrome this base 64 code, there is no problem. Viewing nice on Google Chrome browser.</p>
  
  <p>Summary my question, I need base64 code to Image and save this file my server as jpeg file.
  How can i solve this problem?
  Thanks.</p>