You are here: Re: how to create directory+subdirectory « PHP Programming Language « IT news, forums, messages
Re: how to create directory+subdirectory

Posted by Steve on 01/23/06 11:36

On Mon, 23 Jan 2006 09:24:10 +0100, tomek wrote:

> 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?

have you got safe mode enabled? won't work then.

 

Navigation:

[Reply to this 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

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