From 9b8e03f7a8f24d88b18d073bfb4c53fe454a79c5 Mon Sep 17 00:00:00 2001 From: Richelly Italo Date: Thu, 26 Jul 2018 15:40:47 -0300 Subject: [PATCH] Close file after Upload ran I saw here the need to delete the file and because it was already open (fopen) inside the library, exclusion was not allowed. Now always closing (fclose) the file, this is possible. This is most often used when you want to delete a temporary file after uploading. --- spaces.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spaces.php b/spaces.php index 7da19ac..587147f 100644 --- a/spaces.php +++ b/spaces.php @@ -281,6 +281,10 @@ class SpacesConnect { } catch (\Exception $e) { $this->HandleAWSException($e); + } finally { + if (is_file($pathToFile)) { + fclose($file); + } } }