我在這裏有一個網站http://www.voclr.it/acapellas/我的文件託管在我的Amazon S3帳戶上,但是當訪問者從我的網站上下載MP3時,它迫使他們流式傳輸它,但我真正希望它做的是下載它到那裏桌面。S3 Force Download
我現在在網站上禁用了S3,所以下載工作正常。但真的我想S3搜索MP3
我在這裏有一個網站http://www.voclr.it/acapellas/我的文件託管在我的Amazon S3帳戶上,但是當訪問者從我的網站上下載MP3時,它迫使他們流式傳輸它,但我真正希望它做的是下載它到那裏桌面。S3 Force Download
我現在在網站上禁用了S3,所以下載工作正常。但真的我想S3搜索MP3
require_once '../sdk-1.4.2.1/sdk.class.php';
// Instantiate the class
$s3 = new AmazonS3();
// Copy object over itself and modify headers
$response = $s3->copy_object(
array(// Source
'bucket' => 'your_bucket',
'filename' => 'Key/To/YourFile'
),
array(// Destination
'bucket' => 'your_bucket',
'filename' => 'Key/To/YourFile'
),
array(// Optional parameters
**'headers' => array(
'Content-Type' => 'application/octet-stream',
'Content-Disposition' => 'attachment'**
)
)
);
// Success?
var_dump($response->isOK());
Amazon AWS S3 to Force Download Mp3 File instead of Stream It
我在哪裏可以把這個代碼? –