mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-08-14 02:27:23 -07:00
Oops
Forgot to test changes in your codebase lol
This commit is contained in:
parent
88c6b54b52
commit
36b4d3005f
1 changed files with 15 additions and 10 deletions
25
spaces.php
25
spaces.php
|
@ -288,17 +288,22 @@ class SpacesConnect {
|
|||
*/
|
||||
function DownloadFile($fileName, $destinationPath = false) {
|
||||
try {
|
||||
$result = $this->client->getObject(array(
|
||||
'Bucket' => $this->space,
|
||||
'Key' => $fileName,
|
||||
'SaveAs' => $destinationPath
|
||||
));
|
||||
|
||||
if(!$destinationPath) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
return $this->ObjReturn($result->toArray());
|
||||
$result = $this->client->getObject(array(
|
||||
'Bucket' => $this->space,
|
||||
'Key' => $fileName,
|
||||
));
|
||||
|
||||
return $result['Body'];
|
||||
}else{
|
||||
$result = $this->client->getObject(array(
|
||||
'Bucket' => $this->space,
|
||||
'Key' => $fileName,
|
||||
'SaveAs' => $destinationPath
|
||||
));
|
||||
|
||||
return $this->ObjReturn($result->toArray());
|
||||
}
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
$this->HandleAWSException($e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue