Web Hosting Talk







View Full Version : Could someone tell me how to change file permissions using cgi???


sllik
12-25-2004, 07:22 PM
Could someone tell me how to change file permissions using cgi???

For some reason I'm having trouble with that.... I don't usualy work with cgi, it's kind of confusing.

Thanks.

deadserious
12-25-2004, 10:53 PM
You can't change permissions with CGI, but you probably can with which ever language your CGI script is written in.

For Perl, you can use:

chmod(0755, 'file');

sllik
12-26-2004, 03:57 AM
doesn't look like it works, the chmod is still the same.... I don't get an error though.

deadserious
12-26-2004, 09:43 PM
Did you change the mode? the '0755' was just an example. You need to set it to the actual mode you want to change the permissions on the file to.