我目前正在使用aws2js与Amazon S3进行交互,而我正在使用copyObject函数,但copyObject函数并不是只复制标题的对象。例如:
原始对象:
{ headers:
{ 'x-amz-id-2': 'yTZGt+Jp/wwv+UbQCcfzh7Wsq123H21516GNu123bc4y123Yi/aSXiP2123zSgji0EO',
'x-amz-request-id': '2786D8473EB153D6',
date: 'Sat, 28 Dec 2013 06:52:48 GMT',
'last-modified': 'Sat, 28 Dec 2013 06:34:06 GMT',
'x-amz-version-id': 'dWxmMRG6szNgL5BfZBtw3uOBW123UpXi',
etag: '"52a5f45632d3aa14e747254320123219"',
'accept-ranges': 'bytes',
'content-type': 'application/pdf',
'content-length': '68008',
server: 'AmazonS3' },
buffer: <Buffer 25 50 ...> }
&#34;复制&#34;对象:
{ 'x-amz-id-2': '7sDoDwJbuUydx/57Vp/a0PDMEkSO3c57h37xshLF+OcMYBg34MDPmNcnO0LMVLsC',
'x-amz-request-id': 'FFBFAB7586CEF2DE',
date: 'Sat, 28 Dec 2013 06:52:48 GMT',
'x-amz-version-id': 'WlFR96umHE6yiYD_ec_4_kPtlUhI_sfs',
etag: '"d41d8cg98f06b204e9500998ecf8427e"',
'content-length': '0',
server: 'AmazonS3' }
为什么&#34;复制&#34;并创建一个0字节对象?
var acl = 'private';
var headers = ['x-amz-meta-unique', 'content-type', 'content-encoding'];
aws2js.copyObject('bucket1/filename.pdf', 'bucket2/filename.pdf', acl, headers, function(error, result) {
console.log('result: ', error, result);
});