diff --git a/code/controllers/XHR.php b/code/controllers/XHR.php index 04c566b..c31e405 100644 --- a/code/controllers/XHR.php +++ b/code/controllers/XHR.php @@ -26,6 +26,7 @@ public function saveToTmp() { $this->tmp_handle = fopen($this->tmp_location, "w"); stream_copy_to_stream($input, $this->tmp_handle); fclose($input); + fclose($this->tmp_handle); return true; } diff --git a/code/dataobjects/DisplayAnythingGallery.php b/code/dataobjects/DisplayAnythingGallery.php index 0708bf6..4b9b712 100644 --- a/code/dataobjects/DisplayAnythingGallery.php +++ b/code/dataobjects/DisplayAnythingGallery.php @@ -595,7 +595,7 @@ final public function Upload() { //final location of file $targetDirectory = "/" . trim($this->target_location, "/ "); - $uploadPath = "/" . trim(ASSETS_PATH, "/ ") . $targetDirectory; + $uploadPath = rtrim(ASSETS_PATH, "/ ") . $targetDirectory; $uploadDirectory = ASSETS_DIR . $targetDirectory; if(!is_writable(ASSETS_PATH)) {