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
當然,只是更新我,如果它幫助 –