mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged revisions 48857 via svnmerge from
svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.1-ssopen ........ r48857 | aoneil | 2008-01-31 09:19:00 +1300 (Thu, 31 Jan 2008) | 2 lines fix upload folder ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@48952 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
00bee53763
commit
41b4064c9d
@ -165,7 +165,7 @@ class File extends DataObject {
|
||||
// have been uploaded.
|
||||
$base = dirname(dirname($_SERVER['SCRIPT_FILENAME']));
|
||||
$class = $this->class;
|
||||
$parentFolder = Folder::findOrMake("Uploads");
|
||||
$parentFolder = Folder::findOrMake($folderName);
|
||||
|
||||
// Create a folder for uploading.
|
||||
if(!file_exists("$base/assets")){
|
||||
@ -181,7 +181,7 @@ class File extends DataObject {
|
||||
$file = ereg_replace('-+', '-',$file);
|
||||
$file = basename($file);
|
||||
|
||||
$file = "assets/Uploads/$file";
|
||||
$file = "assets/$folderName/$file";
|
||||
|
||||
while(file_exists("$base/$file")) {
|
||||
$i = isset($i) ? ($i+1) : 2;
|
||||
|
Loading…
Reference in New Issue
Block a user