amazon s3 - Setting metadata on S3 multipart upload -
i'd upload file s3 in parts, , set metadata on file. i'm using boto interact s3. i'm able set metadata single-operation uploads so:
is there way set metadata multipart upload? i've tried this method of copying key change metadata, fails error: invalidrequest: specified copy source larger maximum allowable size copy source: <size>
i've tried doing following:
key = bucket.create_key(key_name) key.set_metadata('some-key', 'value') <multipart upload>
...but multipart upload overwrites metadata.
i'm using code similar this multipart upload.
faced such issue earlier today , discovered there no information on how right. code example on how solved issue provided below.
$uploader = new multipartuploader($client, $source, [ 'bucket' => $bucketname, 'key' => $filename, 'before_initiate' => function (\aws\command $command) { $command['contenttype'] = 'application/octet-stream'; $command['contentdisposition'] = 'attachment'; }, ]);
unfortunately, documentation https://docs.aws.amazon.com/aws-sdk-php/v3/guide/service/s3-multipart-upload.html#customizing-a-multipart-upload doesn't make clear , easy understand if you'd provide alternative meta data multipart upload have go way.
i hope help.
Comments
Post a Comment