我试图从本地主机(XAMPP) 批次/批量上传到我的S3
桶。
这似乎为约6项工作,然后我得到一个错误信息:
卷曲的错误说Failed sending network data.
从http://curl.haxx.se/libcurl/c/libcurl-errors.html
Fatal error: Uncaught exception 'cURL_Multi_Exception' with message 'cURL resource: Resource id #34; cURL error: SSL_write() returned SYSCALL, errno = 0 (cURL error code 55). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.' in D:\xampp\htdocs\path\to\my\files\sdk-1.5.14\lib\requestcore\requestcore.class.php on line 902
和
cURL_Multi_Exception: cURL resource: Resource id #34; cURL error: SSL_write() returned SYSCALL, errno = 0 (cURL error code 55). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes. in D:\xampp\htdocs\path\to\my\files\sdk-1.5.14\lib\requestcore\requestcore.class.php on line 902
继承人我的PHP。 它得到的图像列表从目录,并从该循环我想批量上传这些项目S3
。
require_once('sdk-1.5.14/sdk.class.php');
$s3 = new AmazonS3();
//$s3->disable_ssl_verification(); //this didnt fix it
$folder = "./../";
$handle = opendir($folder);
# Making an array of files in a directory to upload to S3
while ($file = readdir($handle))
{
$files[] = $file;
}
closedir($handle);
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/";
//batch
$response = $s3->batch()->create_object('bucketname', "tempdirectory/" . $file, array(
'fileUpload' => fopen($fileTempName . $file, 'r'),
'acl' => AmazonS3::ACL_PUBLIC
));
}
}
$s3->batch()->send();
更新:在修改后congig.inc.php
现在我收到错误消息:
Fatal error: Uncaught exception 'cURL_Multi_Exception' with message 'cURL resource: Resource id #149; cURL error: Failed connect to mybucket.s3.amazonaws.com:443; No error (cURL error code 7). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.' in D:\xampp\htdocs\sdk-1.5.14\lib\requestcore\requestcore.class.php on line 902
cURL_Multi_Exception: cURL resource: Resource id #149; cURL error: Failed connect to prayerbucket.s3.amazonaws.com:443; No error (cURL error code 7). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes. in D:\xampp\htdocs\sdk-1.5.14\lib\requestcore\requestcore.class.php on line 902