mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-08-19 13:00:31 -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) {
|
function DownloadFile($fileName, $destinationPath = false) {
|
||||||
try {
|
try {
|
||||||
$result = $this->client->getObject(array(
|
|
||||||
'Bucket' => $this->space,
|
|
||||||
'Key' => $fileName,
|
|
||||||
'SaveAs' => $destinationPath
|
|
||||||
));
|
|
||||||
|
|
||||||
if(!$destinationPath) {
|
if(!$destinationPath) {
|
||||||
return $result;
|
$result = $this->client->getObject(array(
|
||||||
}
|
'Bucket' => $this->space,
|
||||||
|
'Key' => $fileName,
|
||||||
return $this->ObjReturn($result->toArray());
|
));
|
||||||
|
|
||||||
|
return $result['Body'];
|
||||||
|
}else{
|
||||||
|
$result = $this->client->getObject(array(
|
||||||
|
'Bucket' => $this->space,
|
||||||
|
'Key' => $fileName,
|
||||||
|
'SaveAs' => $destinationPath
|
||||||
|
));
|
||||||
|
|
||||||
|
return $this->ObjReturn($result->toArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {
|
catch (\Exception $e) {
|
||||||
$this->HandleAWSException($e);
|
$this->HandleAWSException($e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue