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
This commit is contained in:
Sean Harvey 2008-11-05 03:56:22 +00:00
parent 020a92eda8
commit d145c50cc2
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}
/**

View File

@ -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();