mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
020a92eda8
commit
d145c50cc2
@ -145,10 +145,10 @@ class Upload extends Controller {
|
|||||||
* @param File $file
|
* @param File $file
|
||||||
* @return Boolean
|
* @return Boolean
|
||||||
*/
|
*/
|
||||||
public function loadIntoFile($tmpFile, $file) {
|
public function loadIntoFile($tmpFile, $file, $folderPath = false) {
|
||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
|
|
||||||
return $this->load($tmpFile);
|
return $this->load($tmpFile, $folderPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,7 +115,7 @@ class FileField extends FormField {
|
|||||||
|
|
||||||
$this->upload->setAllowedExtensions($this->allowedExtensions);
|
$this->upload->setAllowedExtensions($this->allowedExtensions);
|
||||||
$this->upload->setAllowedMaxFileSize($this->allowedMaxFileSize);
|
$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;
|
if($this->upload->isError()) return false;
|
||||||
|
|
||||||
$file = $this->upload->getFile();
|
$file = $this->upload->getFile();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user