title: How to create downloadable file link for the file to download in ASP.net core
body: <p>Previously I was sending file as <code>Byte array</code> from ASP.net core 2.0 and in Angular 4 application I am calling below function to download the file</p>
  
  <pre><code>function (response) { // Here response is byte array
      var url= window.URL.createObjectURL(res);
      var link = document.createElement("a");
      link.setAttribute("href", url);
      link.setAttribute("download", this.zipLocation + ".zip");
      link.style.display = "none";
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
  }
  </code></pre>
  
  <p>But now I want to send the file path from the server like below</p>
  
  <p><code>https://websiteaddress/file/path/to/download.ext</code></p>
  
  <p>So in Angular 5, I can directly attach link to <code>href</code> attribute of anchor tag and will make automatic click on that. So I don't need to <strong>Convert byte array to url</strong></p>
  
  <p><strong>Here the issue is I don't know how to create that downloadable file path using ASP.net core and send it to frontend</strong></p>
  
  <p>And also I want to know, which approach is better, whether sending <code>Byte array</code> or <code>Sending the direct link</code>? Is there any performance issue with any of the two?</p>