title: MVC WebAPI return multiple images
body: <p>I have 3 images in a directory but my code always returns one of them. I'd like to return 3 images image1.jpg, image2.jpg, image3.jpg and get them in my Xamarin app. </p>
  
  <p>I think returning the result like an array might solve the problem but I don't understand what I need.</p>
  
  <pre><code>        var result = new HttpResponseMessage(HttpStatusCode.OK);
  
          MemoryStream ms = new MemoryStream();
          for (int i = 0; i &lt; 3; i++)
          {
              String filePath = HostingEnvironment.MapPath("~/Fotos/Empresas/Comer/" + id + (i + 1) + ".jpg");
  
              FileStream fileStream = new FileStream(filePath, FileMode.OpenOrCreate);
  
              Image image = Image.FromStream(fileStream);
              image.Save(ms, ImageFormat.Jpeg);
              fileStream.Close();
  
              byte[] bytes = File.ReadAllBytes(filePath);
              byte[] length = BitConverter.GetBytes(bytes.Length);
  
              // Write length followed by file bytes to stream
              ms.Write(length, 0, 3);
              ms.Write(bytes, 0, bytes.Length);
          }
  
          result.Content = new StreamContent(ms);
  
          return result;
  </code></pre>
  
  <p>Now i getting bytes, i edit a little bit the code now</p>
  
  <pre><code>        byte[] imageAsBytes = client.GetByteArrayAsync(url).Result; 
  
          MemoryStream stream1 = new MemoryStream(imageAsBytes);
          img.Source = ImageSource.FromStream(() =&gt; { return stream1; });
  </code></pre>
  
  <p>this is my xamarin code to get images, but i still getting nothing =/ </p>