Jump to content

question with mkdir

- - - - -

  • Please log in to reply
1 reply to this topic

#1
DaveW

DaveW

    Newbie

  • Members
  • Pip
  • 1 posts
So I'm writing a script to allow one of my client to upload product pictures to their ecommerce site. I figured the easiest way to organize would be to create a directory with the product id as the name. So, I'm creating the directory just fine, but the permissions are always being set a 0755, when I need them to be set at 0775.

The code I'm using:
if (!is_dir('test')) mkdir('test',0775);

Now, the thing that really is confusing me, when I FTP into the site, I can change permissions manually on any file or directory. Except the one's made by this script, for those I get " Operation not permitted."

Of course, I can delete the directory, make it through ftp, and set the permissions, and it works fine.

Anyone have any clue how to fix this?

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
a dir created by a script is owned by the web browser user and not your accounts user, so that means you're not the owner, and therefore can't change it.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users