...

View Full Version : CHMOD for Image Upload



daemonkin
11-23-2007, 03:16 PM
Hi guys,

Using PHP to upload images to my server to a correct directory.
All working fine locally but on my linux box I have made the appropriate directory CHMOD 777.

I was wondering if I could leave it at 755. I have built a CMS to do all changes and am only one with access to it.

Is my CMS a public user and hence requires 777 access to write?

On another note does 777 a directory mean that all sub directories are 777?

D.

aWishResigned
11-25-2007, 09:05 PM
Generally, when you want to upload files to a folder, you generally want it set to 777. I've never tried it but, you may be able to set the folder to 755 and then through PHP change the permissions to 777 before the upload and put it back afterwards. It may work since it's a server-side script but it may not; you just have to try it.

Also, if you set a directory to 777, the subs are not set that way too. In most IDEs and FTP programs, you have the option to change subs with it but, by itself, no.

daemonkin
11-26-2007, 08:43 AM
Thanks for the reply. I never thought of changing it back after uploading the image. I may just give that a try!

D.

kreoton
11-27-2007, 07:38 AM
i see that this is question is not in right section 'Client side'. form client side you cannot do anything with server folder permissions... Only php or other programming language can do this check manual for chmod (http://lt2.php.net/chmod) function



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum