title: Download a file from URL with different file name
body: <p>I have below functionality using <strong>JavaScript</strong> </p>
  
  <p>The back end gives me a URL to download a file from like below - </p>
  
  <pre><code>https://something.org/FILENAME.ZIP 
  </code></pre>
  
  <p>So I file name is fixed as <strong>FILENAME.ZIP</strong> </p>
  
  <p>But while downloading a file , the file should get downloaded with custom file name like  <strong>CUSTOMFILENAME.ZIP</strong> instead of <strong>FILENAME.ZIP</strong></p>
  
  <p>So, </p>
  
  <p>1)The file should get downloaded from URL :  <code>https://something.org/FILENAME.ZIP</code> </p>
  
  <p>2)But it should get saved with different file name as : 
  <strong>CUSTOMFILENAME.ZIP</strong> </p>
  
  <p>3)I have tried below programme from url - <a href="https://stackoverflow.com/questions/50487199/how-to-download-a-file-from-url-using-javascript-or-jquery">how to download a file from url using javascript or jquery?</a></p>
  
  <pre><code>var a = document.createElement("a");
  a.href = url;
  var fileName = CUSTOMFILENAME;
  a.download = fileName;
  document.body.appendChild(a);
  a.click();
  window.URL.revokeObjectURL(url);
  a.remove();
  </code></pre>
  
  <p>But still file gets downloaded with <strong>whatever file name mentioned in URL</strong></p>
  
  <p>Can anybody please help me here ? </p>
  
  <p>The file should get saved with <strong>CUSTOMFILENAME</strong> I provide and not <strong>fileName specified</strong> as <strong>part of URL</strong> </p>