title: How to handle filename at response.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(MimeMapping.GetMimeMapping(fileName));
body: <p>Getting Null exception</p>
  <pre><code>try
  {
  var contentBytes = APIWebservice.GetPreview(Global.AuthTicket?.Ticket, fileToken, out var fileName,
  out var isAuthenticated);
  
  if (!isAuthenticated)
  return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, &quot;Not authorized&quot;);
  
  var response = new HttpResponseMessage(HttpStatusCode.OK) {Content = new ByteArrayContent(contentBytes)};
  response.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(MimeMapping.GetMimeMapping(fileName));
  response.Content.Headers.ContentDisposition.FileName = fileName;
  response.Content.Headers.ContentDisposition.Size = contentBytes.Length;
  
  return response;
  }
  </code></pre>
  <p>Getting issue at response.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(MimeMapping.GetMimeMapping(fileName));</p>
  <p><strong>&quot;System.Net.Http.Headers.HttpContentHeaders.ContentDisposition.get returned null.&quot;</strong></p>
  <p>But the out var fileName having value.</p>
  <p>Please..</p>