Amazon S3上传错误:将部件上传到分段上传时发生异常

时间:2015-09-30 10:10:47

标签: php curl amazon-web-services amazon-s3

我正在尝试使用AWS PHP SDK将30 GB文件上传到Amazon S3。

require('../vendor/autoload.php');

use Aws\S3\MultipartUploader;
use Aws\Exception\MultipartUploadException;

$client = new Aws\S3\S3Client([
'version' => 'latest',
'region'  => 'us-east-1'
]);

$bucket_name = 'Server3-27-SEP-2015';
$file_name   = 'S3_www_1443369605.zip';

$uploader = new MultipartUploader($client, $file_name, [
'bucket' => $bucket_name,
'key'    => $file_name,
'part_size' => '5368709120' // 5GB
]);

try {
    $result = $uploader->upload();
    echo "Upload complete \n";
} catch (MultipartUploadException $e) {
    echo "Upload error: " . $e->getMessage() . "\n";
}

适用于最大7GB的文件。上传30 GB文件后,脚本运行约2小时后出现以下错误:

将零件上传到分段上传时发生异常。以下部分有错误: - 第5部分:执行错误" UploadPart" on" https://s3.amazonaws.com/Server3-27-SEP-2015/S3_www_1443369605.zip?partNumber=5&uploadId=xE1ohuuvqnuLyNeU7.TO.BSI6.ld9nchWkoTdWgtS4EyF9rEoRtT3z8SSsaogu6A6u_tb4FPL.WDG056xusaiw--&#34 ;; AWS HTTP错误:cURL错误55:SSL_write()返回SYSCALL,errno = 104(请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html)(服务器):100继续 - - 第4部分:执行错误" UploadPart" on" https://s3.amazonaws.com/Server3-27-SEP-2015/S3_www_1443369605.zip?partNumber=4&uploadId=xE1ohuuvqnuLyNeU7.TO.BSI6.ld9nchWkoTdWgtS4EyF9rEoRtT3z8SSsaogu6A6u_tb4FPL.WDG056xusaiw--&#34 ;; AWS HTTP错误:cURL错误56:SSL读取:错误:00000000:lib(0):func(0):reason(0),errno 104(请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html)(服务器):100继续 - - 第2部分:执行错误" UploadPart" on" https://s3.amazonaws.com/Server3-27-SEP-2015/S3_www_1443369605.zip?partNumber=2&uploadId=xE1ohuuvqnuLyNeU7.TO.BSI6.ld9nchWkoTdWgtS4EyF9rEoRtT3z8SSsaogu6A6u_tb4FPL.WDG056xusaiw--&#34 ;; AWS HTTP错误:cURL错误56:SSL读取:错误:00000000:lib(0):func(0):reason(0),errno 104(请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html)(服务器):100继续 - - 第1部分:执行错误" UploadPart" on" https://s3.amazonaws.com/Server3-27-SEP-2015/S3_www_1443369605.zip?partNumber=1&uploadId=xE1ohuuvqnuLyNeU7.TO.BSI6.ld9nchWkoTdWgtS4EyF9rEoRtT3z8SSsaogu6A6u_tb4FPL.WDG056xusaiw--&#34 ;; AWS HTTP错误:cURL错误55:SSL_write()返回SYSCALL,errno = 104(请参阅http://curl.haxx.se/libcurl/c/libcurl-errors.html)(服务器):100继续 -

2 个答案:

答案 0 :(得分:0)

Amazon S3允许您上传多个部分的大型文件,并且必须对大于5 GB的文件使用分段上传。 AWS SDK for PHP公开了高级ws \ S3 \ Model \ MultipartUpload \ UploadBuilder类,简化了分段上传。 Aws \ S3 \ Model \ MultipartUpload \ UploadBuilder类最适合用于简单的分段上传。

答案 1 :(得分:-1)

此错误,可以通过 3 种方式修复。哪一个适合你? ,您可以在此视频中找到,它帮助我成功上传了 jar。 https://www.youtube.com/watch?v=tONI9QqCpqM