diff options
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r-- | lib/private/files/view.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 94be7114865..519ed250b1f 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -629,10 +629,21 @@ class View { } public function fromTmpFile($tmpFile, $path) { + if (Filesystem::isValidPath($path)) { + + // Get directory that the file is going into + $filePath = dirname($path); + + // Create the directories if any + if (!$this->file_exists($filePath)) { + $this->mkdir($filePath); + } + if (!$tmpFile) { debug_print_backtrace(); } + $source = fopen($tmpFile, 'r'); if ($source) { $this->file_put_contents($path, $source); |