mirror of
https://github.com/SociallyDev/Spaces-API.git
synced 2025-07-06 04:51:32 -07:00
Allow uploading files from URL (#56)
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
1e94b00b13
commit
39063d7831
1 changed files with 1 additions and 1 deletions
|
@ -168,7 +168,7 @@ class Space {
|
|||
$content = fopen($filePath, "r");
|
||||
$result = $this->s3->upload($this->name, $saveAs, $content, $privacy);
|
||||
|
||||
fclose($content);
|
||||
if(is_resource($content)) { fclose($content); }
|
||||
return SpacesResult($result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue