in reply to Re: Re: Re: Re: Unlink on NT
in thread Unlink on NT

Yes the site is password protected. So if a user logs in a uploads a file does it belong to the system or the user? If the user, how do I change it so that it belongs and can be accessed by the whole site?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Unlink on NT
by grantm (Parson) on Oct 18, 2002 at 18:41 UTC

    OK, if you're running IIS and the site is password protected, then forget everything I said about the IUSR_MACHINE_NAME user :-)

    First of all, make sure you have a group that all the users are in ('Domain Users' will do). Then, give that group 'Full control' on the directory where you store the files. If that's not enough, then try adding this to your script...

    chmod(0666, $filename)

    ... after you create the file. (Note that 0666 is an octal number, you need the leading zero and don't put it in quotes). The 'chmod' function is really a unixy thing but if it does what you need then it's a simple solution.

    If 'chmod' doesn't do it, then you can use the Win32::FileSecurity module that comes with ActivePerl. This is adapted from the man page:

    use Win32::FileSecurity qw(Get Set MakeMask); my %hash; $perms = MakeMask( qw( FULL ) ); Get( $filename, \%hash ) ; $hash{$group_name} = $perms; Set( $filename, \%hash ) ;

    good luck