mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-06 13:01:33 -07:00
Allow uploading files from URL
When uploading files from a URL, and if the server closes the connection directly after sending the file, then the resource will be invalid and an exception will be thrown when trying to close it. The supposed fix is to check if the resource is valid.
This commit is contained in:
parent
28fbd13ef6
commit
7e23a96a6a
1 changed files with 1 additions and 1 deletions
|
@ -168,7 +168,7 @@ class Space {
|
||||||
$content = fopen($filePath, "r");
|
$content = fopen($filePath, "r");
|
||||||
$result = $this->s3->upload($this->name, $saveAs, $content, $privacy);
|
$result = $this->s3->upload($this->name, $saveAs, $content, $privacy);
|
||||||
|
|
||||||
fclose($content);
|
if(is_resource($content)) { fclose($content); }
|
||||||
return SpacesResult($result);
|
return SpacesResult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue