我试过了:
$objS3->putObject(array(
'Bucket' => $sBucket
'Key' => $sBucketFolder . $sFilenameToSave,
'SourceFile' => $sFile,
'ACL' => 'public-read'
'Metadata' => [
'Content-Type' => 'text/css',
'Content-Encoding' => 'gzip',
]
));
但这没有用.任何想法?
Tks.
解决方法:
ContentType和ContentEncoding不应作为元数据发送.使用此代替:
$objS3->putObject(array(
'Bucket' => $sBucket
'Key' => $sBucketFolder . $sFilenameToSave,
'SourceFile' => $sFile,
'ACL' => 'public-read',
'ContentType' => 'text/css',
'ContentEncoding' => 'gzip'
));