From d145c50cc20c8f3efd868ee1397bac3304ec6c5a Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 5 Nov 2008 03:56:22 +0000 Subject: [PATCH] ENHANCEMENT Folder name can now be used for uploading files. Ticket #3026 - Thanks simon_w! git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65266 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/Upload.php | 4 ++-- forms/FileField.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/filesystem/Upload.php b/filesystem/Upload.php index 7451dacd7..92050ea0a 100644 --- a/filesystem/Upload.php +++ b/filesystem/Upload.php @@ -145,10 +145,10 @@ class Upload extends Controller { * @param File $file * @return Boolean */ - public function loadIntoFile($tmpFile, $file) { + public function loadIntoFile($tmpFile, $file, $folderPath = false) { $this->file = $file; - return $this->load($tmpFile); + return $this->load($tmpFile, $folderPath); } /** diff --git a/forms/FileField.php b/forms/FileField.php index f8a0efa01..3a824ec1a 100755 --- a/forms/FileField.php +++ b/forms/FileField.php @@ -115,7 +115,7 @@ class FileField extends FormField { $this->upload->setAllowedExtensions($this->allowedExtensions); $this->upload->setAllowedMaxFileSize($this->allowedMaxFileSize); - $this->upload->loadIntoFile($_FILES[$this->name], $file); + $this->upload->loadIntoFile($_FILES[$this->name], $file, $this->folderName); if($this->upload->isError()) return false; $file = $this->upload->getFile();