/    Sign up×
Community /Pin to ProfileBookmark

File Folders

Hi

I have been searching for a tutorial that will give me some guidance on creating a file folder system for my my members.

The initial folder in the root directory will be called memberPhots.

With in this folder each member will have a subfolder created for them. The folder name will be their username.

Next I want to give members the ability to create additional subfolders in thier folder.

Hope this makes sense. If any one can point me to information to get me started. that would be excellent

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@tcaJul 12.2007 — mkdir

Also, read up on isdir

You will need something like this:

[code=php]

//very simplified!

$new_dir = 'path/' . $username;

if (!isdir($new_dir) {
mkdir($new_dir) ;
}
[/code]


TC
Copy linkTweet thisAlerts:
@kprocauthorJul 12.2007 — thank you for the post, this is my first time tying to setup a directory system. I did some google searching and have not come across a tutorial that show how to do this.

any further pointers are excellent
Copy linkTweet thisAlerts:
@kprocauthorJul 13.2007 — this is what i have this far but I'm getting an error message



Warning: mkdir() [function.mkdir]: File exists in /mnt/w0400/d11/s01/b02a5c57/www/familyclick.ca/FileSysem.php on line 15

any ideas
[code=php]
<?php
//very simplified!
$subFolderName = $_POST['subFolderName'];

if(isset($_POST['subFolderName'])){

$user_name = 'proctk';
$file_folder = 'user_images/'.$user_name.'/'.$subFolderName;

mkdir($file_folder);

}
?>
[/code]
×

Success!

Help @kproc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...