Folder permissions

Hi,

I’m developing a system where a directory is created for a particular user in which images etc are stored. I’ve managed to create the directories ok, but the owner is set to 99 as opposed to me, the result being I can’t then remove the folders or their contents. Is there a way I can change the owner through PHP after the file is created?

I’ve tried using CHMOD but its not done the trick (code below)

chmod('path/to/mydir', 4755);

(I found the 4755 on another forum)

Cheers
Phil