Add this to 'environment/functions/files.php':
function force_mkdir_from_base($base, $path, $chmod = null) {
if(is_dir(with_slash($base).$path)) return true;
$real_path = str_replace('\\', '/', $path);
$parts = explode('/', $real_path);
$forced_path = '';
foreach($parts as $part) {
if($part !='')
{
// Skip first on windows
if($forced_path == '') {
$forced_path = with_slash($base) . $part;
} else {
$forced_path .= '/' . $part;
} // if
if(!is_dir($forced_path)) {
if(!is_null($chmod)) {
if(!mkdir($forced_path)) return false;
} else {
if(!mkdir($forced_path, $chmod)) return false;
} // if
} // if
} // if
} // foreach
and change line 165 of 'library/filerepository/backend/FileRepository_Backend_FileSystem.class.php' from:
if(!force_mkdir($destination_dir, 0777)) {
to:
if(!force_mkdir_from_base($this->getRepositoryDir(), dirname($this->idToPath($file_id)), 0777)) {
and revert changes to 'init.php':
define('FILES_DIR', ROOT . '/upload'); // place where we will upload project files