Merge pull request #6975 from nextcloud/s3-read-object-fopen
use fopen directly when reading objects from s3
This commit is contained in:
commit
defc4bf6a8
|
@ -49,12 +49,15 @@ trait S3ObjectTrait {
|
||||||
'Bucket' => $this->bucket,
|
'Bucket' => $this->bucket,
|
||||||
'Key' => $urn
|
'Key' => $urn
|
||||||
]);
|
]);
|
||||||
$command['@http']['stream'] = true;
|
$request = \Aws\serialize($command);
|
||||||
$result = $client->execute($command);
|
$opts = [
|
||||||
/** @var StreamInterface $body */
|
'http' => [
|
||||||
$body = $result['Body'];
|
'header' => $request->getHeaders()
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
return $body->detach();
|
$context = stream_context_create($opts);
|
||||||
|
return fopen($request->getUri(), 'r', false, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue