0

I have a link of another domain (ex : http://domain2.com/file.zip ). Can i ask how to hide this link and force download. I try but can't hide this file url;

header('Content-Description: File Transfer');
header("Location: $datas", true, 303);
Mif.ComicVN
  • 87
  • 1
  • 6

1 Answers1

0

You will need to look into something like readfile. See example one for the code to set it up with. You will probably need to change the content-type header to be: header('Content-Type: application/octet-stream'); as an fyi.

EDIT

Also, since that will be reading from your other domain, it will download to your server to the user's computer, so it will be "dupping" bandwidth so to speak. If you have access to the other domain / it is on the same server, it would probably be better to read that file locally, or setup a similar download script at domain2, so you just redirect them to that download script for domain2 instead of the file.

Jim
  • 18,673
  • 5
  • 49
  • 65