title: .NET WEB API Open an image file in to a new browser tab by using FTP
body: <p>I have an function that use FTP protocol to download an Image from the other site. But now i want to open it into a new tab, not downloading it. Here is my C# code to download it. Thanks for reading </p>
  
  <pre><code>byte[] byteFTP = ftpclass.ReadFTPFile(results, ConfigCache.HostURL, ConfigCache.UserName, ConfigCache.Password);
  if (byteFTP != null)
  {
      HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
      var dataStream = new MemoryStream(byteFTP);
      response.Content = new StreamContent(dataStream);
      response.Content.Headers.ContentDisposition = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment");
      response.Content.Headers.ContentDisposition.FileName = results;
      response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");
      response.Content.Headers.ContentLength = dataStream.Length;
      return response;
  }
  </code></pre>