1
我使用上面的代码在文件中写入:如何使用stream aws s3 php在文件末尾写入?
require 'vendor/autoload.php';
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
$client = S3Client::factory(array(
'credentials' => array(
'key' => 'key',
'secret' => 'secret',
)
));
$client->registerStreamWrapper();
$stream = fopen("s3://bucket-name/files/filename.txt", 'w');
fwrite($stream, $message);
fclose($stream);
它的工作原理,但我需要的文件保存内容的末尾写已经所著...我想用'W + '是解决方案,但诺伊, PLZ我该怎么做?
谢谢。
根据文档,你应该使用'a'。 http://php.net/manual/en/function.fopen.php –
谢谢,好吧,我会尝试一下。 – user3911183
当然,只是更新我,如果它帮助 –