title: How can I convert String (which is actually Bitmap) to IFormFile in asp.net core 1.0 c#
body: <p>Basically what I am trying to do is sending a string which was bitmap(I converted into string ) and send t to Asp.net core 1.0 web application/api. I want to save that image into the hosted application files and path of that image to database but I do not understand how can I convert that string into IFormFile so I can copy It to the specific path.</p>
  <pre><code>        List&lt;byte&gt; splitBytes = new List&lt;byte&gt;();
          string byteString = &quot;&quot;;
  
          foreach (var chr in obj.bitmapstr)
          {
              byteString += chr;
  
              if (byteString.Length == 3)
              {
                  splitBytes.Add(Convert.ToByte(byteString));
                  byteString = &quot;&quot;;
              }
          }
  
          if (byteString != &quot;&quot;)
              splitBytes.AddRange(Encoding.ASCII.GetBytes(byteString));
  
          using (var ms = new MemoryStream(splitBytes.ToArray()))
          {
  
             
  
               // SixLabors.ImageSharp.Image img = SixLabors.ImageSharp.Image.FromStream()
  
              //  ms.Write(splitBytes.ToArray(), 0, splitBytes.ToArray().Length);
  
  
              //   var img = System.Drawing.Image.FromStream(ms);
  
              //do something with image.
          }
  </code></pre>
  <p>I have tried converting it to Byte array but don't know what to do with that.</p>
  <pre><code>             Uri path=data.getData();
                 
              Bitmap bitmap=MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(),path);
              phtotimage.setImageBitmap(bitmap);
               phtotimage.setVisibility(View.VISIBLE);
              String bitMapToString=BitMapToString(bitmap);
             getconnection(&quot;url&quot;,bitMapToString);
  </code></pre>
  <p>This is the code in android studio to get the file and convert it into string and pass that file</p>