views:

78

answers:

2

I need to grant write permission to temporary folder of all local machine (if it does not have)which access my php site. Is it possible using PHP?

+1  A: 

You can use the php function chmod. You want to be careful of course but you could say

chmod('/path/to/my/folder',777);

Or whatever write permissions you want.

http://php.net/manual/en/function.chmod.php

jnunn
This won't work.
Josh K
Well, it works, but not for the task described in this question (grant folder permissions on *client* machine).
Jørn Schou-Rode
Which means it won't work *in this context* and is a *wrong answer*.
Josh K
I assumed by local machine he's talking his machine.
jnunn
+4  A: 

No, you can't because PHP works server-side only! PHP is used to create HTML output and cannot access files on client-side machines.

chmod('path/to/my/folder',777); will only change file permissions on the server machine - never on a client!

Thariama
+1, though you should format that as `chmod('path/to/my/folder', 777);`
Josh K
done: it is bold now
Thariama
-0 since he obviously understands the client/server side problem and is talking about localhosts which run his script, yet the command in your answer is fine.
Mikulas Dite
well, i assume that he is talking about clients accessing his website because he asks for "all local machine ... which access my php site".
Thariama
Thank you for caring and all of your comments.
Ajith