AWS S3 batch upload from localhost php error

陌路散爱 提交于 2019-12-03 20:36:04

Try set limit for batch:

$batch = new CFBatchRequest(2); // only two instance at once

foreach ($files as $file) { 
        $path_parts = pathinfo($file);
        if(isset($path_parts['extension']) && $path_parts['extension'] != '') {

                // local path
                $fileTempName = "D:/xampp/htdocs/path/to/my/files/";

                // if batch, it have to return curl's resource
                $curl_handler = $s3->batch($batch)->create_object('bucketname', "tempdirectory/" . $file, array(
                        'fileUpload' => fopen($fileTempName . $file, 'r'),
                        'acl' => AmazonS3::ACL_PUBLIC
                ));

        }

}
// batch object send queue
$batch->send();

Try setting 'certificate_authority' to true in the config.inc.php.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!