title: Delphi: download a file with URL Forwarding
body: <p>I have a free domain name with URL Forwarding (<strong>Cloaking</strong>) to another site.</p>
  
  <p>If I type <a href="http://my.com/1.zip" rel="nofollow noreferrer">http://my.com/1.zip</a> in browser's web-address then it goes to <a href="http://his.com/1.zip" rel="nofollow noreferrer">http://his.com/1.zip</a> and downloads a file.</p>
  
  <p>How can I do the same with Indy TIdHTTP (Delphi XE2). Browsers and I get 404-error at first but then they somehow download a file except me.</p>
  
  <p>I need to use the first link but actually download from another site. E.g. the first site has a xxx.zip file. I want to go to <a href="http://my.com/xxx.zip" rel="nofollow noreferrer">http://my.com/xxx.zip</a> but actually to download from <a href="http://his.com/xxx.zip" rel="nofollow noreferrer">http://his.com/xxx.zip</a> (where the file stores).</p>
  
  <p>Thanks!</p>
  
  <h2>Edited:</h2>
  
  <p>I set <code>HandleRedirects</code> to true, assigned a <code>CookieManager</code> (I've already seen this question <a href="https://stackoverflow.com/questions/4549809/indy-idhttp-how-to-handle-page-redirects">Indy - IdHttp how to handle page redirects?</a>).</p>
  
  <p><strong>Try to download</strong> this <a href="http://liga-updates.ua.tc/GDI+.zip" rel="nofollow noreferrer">http://liga-updates.ua.tc/GDI+.zip</a> in your Delphi</p>