in reply to Re: Re: Re: Re: Setting file upload permissions
in thread Setting file upload permissions

chmod'ing before you save only works if the file already exists, duing the save makes no sense at all. After is really what you should be doing. But ... you are missing something ... always check to see if the operation worked:
chmod $mode, '$filename' or die "can't chmod: $!";
I'll wager my money that a user other than the one that your web server runs as (prolly you) owns that file or the directory that will contain that file. Make sure you first manually chown -R that directory to the user that your web server runs as first. You can find out who that user is with a quick:

grep ^User /path/to/apache/conf/httpd.conf
on a *NIX command line.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) 5Re: Setting file upload permissions
by sulfericacid (Deacon) on Apr 18, 2003 at 20:16 UTC
    I don't quite understand what you mean about the *NIX line (I'm an XP user and this is run on the perlmonk.org server). I am trying to upload to /home/sulfericacid/public_html/upload/files which has permissions set at: rwxrwxrwx.

    I no longer use or die because it kills my script. This was discussed a little in the CB yesterday but on all the scripts I added that line to my entire script crashed and did nothing, but without it the script works :S. Kind of weird but this or die didn't crash the screen, it didn't load any of the text it should have loaded after it.

    I have no clue what chown is but I'll take a quick look at that, thanks for your help!

    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid