Reply to how to create directory+subdirectory

Your name:

Reply:


Posted by tomek on 01/23/06 10:24

hi
i'm desperate... i'm trying this for 2 days now... so if anyone can help -
please.

i have upload form in which users can choose TYPE of file they are uploading
(graphic/text/music) - and STATUS of that file (draft/finished). So, my
upload script is getting:
- $_FILE field,
- TYPE of file (it is string representing "DIRECTORY")
- STATUS of file (it is string representing "SUBDIRECTORY")

i cannot find working function or script to upload file to
"DIRECTORY/SUBDIRECTORY/" if that 2 dirs doesn' exist.

how can i create 2 dirs ? i tried recursively...
=================================================

function mkdirs($dir, $mode = 0777, $recursive = true) {
if( is_null($dir) || $dir === "" ){
return FALSE;
}
if( is_dir($dir) || $dir === "/" ){
return TRUE;
}
if( mkdirs(dirname($dir), $mode, $recursive) ){
return mkdir($dir,0777); // the default chmod
}
return FALSE;
}
==================================================

but it only creates first one, but not other (subdirectory) - like created
dir doesn't have permissions ??

anyone?

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация