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:
Andrew O'Neil 2008-02-01 01:21:42 +00:00
parent 00bee53763
commit 41b4064c9d

View File

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