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? 4 5837
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.
> > how can i create 2 dirs ? i tried recursively... ================================================= 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.
how can i know is that safemode enabled and where can i enabe it?
"ToMeK" <t_***@hotmail.com> wrote in message
news:dr**********@ss405.t-com.hr... how can i create 2 dirs ? i tried recursively... ================================================= 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.
how can i know is that safemode enabled and where can i enabe it?
i just contacted my provider and he says that they cannot change "safe_mode"
tag.
he mention something about "create directories with my UID" ? can anyone
tell me more details on that? (UID)
thanks.
is there another way? maybe ftp?
"ToMeK" <t_***@hotmail.com> wrote in message
news:dr**********@ss405.t-com.hr... "ToMeK" <t_***@hotmail.com> wrote in message news:dr**********@ss405.t-com.hr... > > > > how can i create 2 dirs ? i tried recursively... > > ================================================= > > 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.
how can i know is that safemode enabled and where can i enabe it?
i just contacted my provider and he says that they cannot change "safe_mode" tag. he mention something about "create directories with my UID" ? can anyone tell me more details on that? (UID)
user id? it sould like he's referring to an ftp client thing
look. you have a function that creates one directory successfully.
sometimes you can create a whole path at once. it is possible you have to
create them nested one by one. so maybe you have to explode() the dir
string and walk through them one by one & chdir+mkdir. you could do it
recursively, or iteratively.
it's just another method.
you might also consider that you might need to chdir somewhere first before
you start your first mkdir, or at least prepend an absolute path like (what
was it?) $_SERVER[DOCUMENT_ROOT]. Otherwise, who knows where your created
directory will end up. and because of that, it might fail if it's in a
restricted area. thanks.
is there another way? maybe ftp?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Lise |
last post by:
Hi all ..
I have a directory with several subdirectories and a number of files in
each.
These files are accessed by going to a web page and clicking in a listbox
and navigating to the desired...
|
by: Bill |
last post by:
Will IIS6.0 recognize a global.asa file located in a subdirectory on the
webserver?
I'd like a file that will execute whenever a file in the subdirectory is
browsed - or, at least it is...
|
by: STeve |
last post by:
Hey guys,
I couldn't find any documentation on visual c# how to copy the
contents of one directory to another directory (directory includes
files and a few subdirectories -- that do not contain...
|
by: Amos Soma |
last post by:
Does anyone know the easiest way, in C#, to copy all directories and files
starting with some root directory? For example, how might I copy all files
and directories starting with 'C:\Program...
|
by: RML |
last post by:
hey guys,
i am looking at this piece of code that lists numbers of files in a
directory. i want to convert it so it lists the files in th directory that
end with .doc. i cant seem to get it to...
|
by: sandy |
last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory',
within my class Directory (Can you already smell disaster?)
Each Directory can have subdirectories so I thought to put these...
|
by: jayeshthakker |
last post by:
how to generate directory & sub directory like
comp0001
comp0001y001
comp0001y002
comp0001y003
comp0002
comp0002y001
comp0002y002
|
by: Claire |
last post by:
Ive written a small string resource building utility that I send out to our
translators. I have a setup project for each language we support, which
picks
out a group of 12 english resx files plus...
|
by: deepaks85 |
last post by:
Dear All,
I know how to display contents of any directory. But what if I need to print the directory, subdirectory and its contents?
The output should be:
Folder
Subfolder
- File1
...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |