Permissions for mkdirs

Permissions for mkdirs

am 28.10.2006 23:18:47 von Andrew Darby

Good people of php-db: Forgive me, this is more of a php than a
php-db question, but here goes: In a little php/mysql application, I
have users ftp over a folder full of images. When they "register" a
folder that's not already in the MySQL db, it creates three different
folders (thumb, medium, large) with a looped mkdir(). When they
register a new image in the db, it resizes into the three folders,
then reduces the image in the root of the folder to thumbnail size.

The problem I'm running into is with ownership and permissions. I
seem to need all folders to have permissions of 777 to work, and then
once they've been created, I can't delete them, because I guess they
were created by the server rather than me. (I'm on a shared host if
this is relevant.)

Anybody done something similar before and have ideas of how best to
handle this sort of situation?

Thanks,

Andrew

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Permissions for mkdirs

am 29.10.2006 00:06:36 von Andrew Darby

Unfortunately, I can't get in to the conents of the folder to change
the permissions!

More generally, I'm wondering if there's a better/best practice way of
doing this. Or changing the ownership of the file to me--but I'm not
sure who is me, and who this file is being created as when I run a
script. Again, this is being run on a shared server.

Any further ideas?

Thanks,

Andrew

On 10/28/06, Bastien Koert wrote:
>
> if you are looking to delete the folder when the user leaves or for some
> other reason, then you need to ensure that the images themselves also have
> the permissions (0777) to allow you to delete them before you can delete the
> folder...
>
> bastien
>
> >From: "Andrew Darby"
> >To: php-db@lists.php.net
> >Subject: [PHP-DB] Permissions for mkdirs
> >Date: Sat, 28 Oct 2006 17:18:47 -0400
> >
> >Good people of php-db: Forgive me, this is more of a php than a
> >php-db question, but here goes: In a little php/mysql application, I
> >have users ftp over a folder full of images. When they "register" a
> >folder that's not already in the MySQL db, it creates three different
> >folders (thumb, medium, large) with a looped mkdir(). When they
> >register a new image in the db, it resizes into the three folders,
> >then reduces the image in the root of the folder to thumbnail size.
> >
> >The problem I'm running into is with ownership and permissions. I
> >seem to need all folders to have permissions of 777 to work, and then
> >once they've been created, I can't delete them, because I guess they
> >were created by the server rather than me. (I'm on a shared host if
> >this is relevant.)
> >
> >Anybody done something similar before and have ideas of how best to
> >handle this sort of situation?
> >
> >Thanks,
> >
> >Andrew
> >
> >--
> >PHP Database Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> ____________________________________________________________ _____
> Ready for the world's first international mobile film festival celebrating
> the creative potential of today's youth? Check out Mobile Jam Fest for your
> a chance to WIN $10,000! www.mobilejamfest.com
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Permissions for mkdirs

am 29.10.2006 00:10:50 von Bastien Koert

chmod will work for both folders and files...

bastien

>From: "Andrew Darby"
>To: "Bastien Koert"
>CC: php-db@lists.php.net
>Subject: Re: [PHP-DB] Permissions for mkdirs
>Date: Sat, 28 Oct 2006 18:06:36 -0400
>
>Unfortunately, I can't get in to the conents of the folder to change
>the permissions!
>
>More generally, I'm wondering if there's a better/best practice way of
>doing this. Or changing the ownership of the file to me--but I'm not
>sure who is me, and who this file is being created as when I run a
>script. Again, this is being run on a shared server.
>
>Any further ideas?
>
>Thanks,
>
>Andrew
>
>On 10/28/06, Bastien Koert wrote:
>>
>>if you are looking to delete the folder when the user leaves or for some
>>other reason, then you need to ensure that the images themselves also have
>>the permissions (0777) to allow you to delete them before you can delete
>>the
>>folder...
>>
>>bastien
>>
>> >From: "Andrew Darby"
>> >To: php-db@lists.php.net
>> >Subject: [PHP-DB] Permissions for mkdirs
>> >Date: Sat, 28 Oct 2006 17:18:47 -0400
>> >
>> >Good people of php-db: Forgive me, this is more of a php than a
>> >php-db question, but here goes: In a little php/mysql application, I
>> >have users ftp over a folder full of images. When they "register" a
>> >folder that's not already in the MySQL db, it creates three different
>> >folders (thumb, medium, large) with a looped mkdir(). When they
>> >register a new image in the db, it resizes into the three folders,
>> >then reduces the image in the root of the folder to thumbnail size.
>> >
>> >The problem I'm running into is with ownership and permissions. I
>> >seem to need all folders to have permissions of 777 to work, and then
>> >once they've been created, I can't delete them, because I guess they
>> >were created by the server rather than me. (I'm on a shared host if
>> >this is relevant.)
>> >
>> >Anybody done something similar before and have ideas of how best to
>> >handle this sort of situation?
>> >
>> >Thanks,
>> >
>> >Andrew
>> >
>> >--
>> >PHP Database Mailing List (http://www.php.net/)
>> >To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>>
>>__________________________________________________________ _______
>>Ready for the world's first international mobile film festival celebrating
>>the creative potential of today's youth? Check out Mobile Jam Fest for
>>your
>>a chance to WIN $10,000! www.mobilejamfest.com
>>
>>

____________________________________________________________ _____
Experience Live Search from your PC or mobile device today.
http://www.live.com/?mkt=en-ca

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php