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
|