Forgot to test changes in your codebase lol
This commit is contained in:
andynazay153 2018-06-12 19:52:19 -07:00 committed by GitHub
commit 36b4d3005f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,18 +288,23 @@ class SpacesConnect {
*/ */
function DownloadFile($fileName, $destinationPath = false) { function DownloadFile($fileName, $destinationPath = false) {
try { try {
if(!$destinationPath) {
$result = $this->client->getObject(array(
'Bucket' => $this->space,
'Key' => $fileName,
));
return $result['Body'];
}else{
$result = $this->client->getObject(array( $result = $this->client->getObject(array(
'Bucket' => $this->space, 'Bucket' => $this->space,
'Key' => $fileName, 'Key' => $fileName,
'SaveAs' => $destinationPath 'SaveAs' => $destinationPath
)); ));
if(!$destinationPath) {
return $result;
}
return $this->ObjReturn($result->toArray()); return $this->ObjReturn($result->toArray());
} }
}
catch (\Exception $e) { catch (\Exception $e) {
$this->HandleAWSException($e); $this->HandleAWSException($e);
} }