write uploaded files with php

leinad256

Registered
Hi guys!
I have a question, but I couldnt find the answer in the search. I am delevopting a php system where any user can upload files (it's easy :p ) . But I have a special control panel where some registered users can modify the uploaded files (the files are html, just) but I cant modify it by the permissions. I can change the permission with the terminal or changing the file info with (where is the apple key????) + i, setting the owner like 'www' :p. Obviuosly, the registered users cant do it, because they are in a remote computer. I was looking the chmod function, but I can give it the right mode argument or if you have a better idea, tell me please!!!


P.D. Excuse my bad english, but I can give you good spanish lesson's in trade of it :D

thank everybody!!!
 
try something like:

umask( 0 );
chmod( 'file', 0777 );

i don't know who needs to edit what in your setup, but that will allow anyone to do anything, so be careful.

it sounds like there shouldnt be a problem as long as everyone is editing via your site. php saves uploaded files as 644 by default, meaning www can read and write anyway. good luck, hope this helps.
 
Back
Top