我有我的網站http://domain1.com
,我想從另一個域http://domain2.com/uploads/data.zip
下載一些.zip
文件,但沒有下載並顯示302移動了臨時錯誤。我正在使用cURL代碼。如何使用PHP下載.zip文件
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");
其中是捲曲代碼?? –
可能的重複[有沒有辦法使用命令行跟蹤重定向cURL](http://stackoverflow.com/questions/18474690/is-there-a-way-to-follow-redirects-with-command-line-捲曲) – TomTom101