I have my website in http://domain1.com and I want to download some .zip file from another domain http://domain2.com/uploads/data.zip but not getting download and showing 302 moved temporary error. I am using cURL code.
header('Access-Control-Allow-Origin: http://www.domain2.com');
header('Content-Length: '.filesize($response));  
header('Content-Type: application/zip');
header('Content-Transfer-Encoding: Binary');  
header("Content-Disposition: attachment; filename=my.zip");
//readfile($response);
header("Location:$response");
 
     
    