title: How to close a popup downloading a file after the download is complete
body: <p>I send a query string to popup windows and download files from the server.
  I want to close the popup after the download is complete but I don't know how.</p>
  
  <p>My Javascript code that sends the query string is:</p>
  
  <pre><code>var url = "../Msg/pgmsgAttachmentDownload.aspx?ID=" + ID;
  window.open(url, '_blank', "top=100,left=100,menubar=0,resizable=1,width=670,height=520,scrollbars=yes,status=yes", true);
  </code></pre>
  
  <p>My code that downloads a file from the popup page (pgmsgAttachmentDownload.aspx) is:</p>
  
  <pre><code>System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
  response.ClearContent();
  response.Clear();
  response.ContentType = "text/plain";
  response.AddHeader("Content-Disposition", "attachment; filename=" + newfilename + ";");
  response.TransmitFile(Server.MapPath(bomsgAttachments.FilePath));
  response.Flush();
  response.End();
  </code></pre>
  
  <p>My code doesn't work in Chrome, but works and closes windows in IE and Firefox.</p>