Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File upload Problems
#24
so, below is my suggested replacement for this function in inc.FileUtils.php:

PHP Code:
function makeDir($path)
{
global 
$settings;
$path1 $settings->_contentDir//from config
$path2 substr_replace ($path"/"0strlen($path1));

    
$mkfolder $path1;
    
    
$path preg_split"/[\\\\\/]/" $path2 );
        
    for(  
$i=; isset( $path[$i] ) ; $i++ )
    {
        if(!
strlen(trim($path[$i])))continue;
        
$mkfolder .= $path[$i];
        
//echo $mkfolder." -> ";
        
        
if( !is_dir$mkfolder ) ){
            
$res= @mkdir"$mkfolder,  0777);
            if (!
$res) return false;    
        }
        
$mkfolder .= DIRECTORY_SEPARATOR;
    }
    
    return 
true;


I am also attaching the modified file. PLEASE ALWAYS BACKUP YOUR FILES BEFORE ANY FILE REPLACEMENT OR MODIFICATION.

try is spacecop - use the attached file (replace yours in /inc/ folder) and let us know...
Matteo... please check my logic....
Reply


Messages In This Thread
File upload Problems - by spacecop - 08-09-2010, 03:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)