View Full Version : Can folders be created via script instructions ?

01-24-2010, 08:02 PM
I've got to make a decison about storage of files. My ID system within mysql will cope with storing and getting data but I'm concerned about whether you can automatically create a folder to receive posted files. For example, I think it might be useful to gather a set of song files for one author into one folder which can be accessed by a music player. As such, I'd like to know if creating a new folder on the fly is a possibility using php scripting.
If it is possible, could somebody explain how it's done.
Thanks -

01-25-2010, 06:00 AM
Never used it myself but try....

mkdir() //add directory


rmdir() // remove directory

You can find out more about it here.....


Hope this helps.


01-25-2010, 10:49 AM
You can also pass in full OS commands by using system()

For example, you can interact with your OS (Linux) using...

system("zip file.zip file1 file2 file3 *.txt")system("mkdir dirname")system("mv movefilename path/newfilename")