>I have a perl script that accepts file uploads.  When the file uploads are
>recieved, the user is wwwrite. I am unable to go back in and delete files
>because of this(Permission is denied ).  I'd like to change the user on the
>upload but I'm not sure how to do this.

Have you instead considered changing the permission of the files after they 
have been uploaded??

in the same script where you are doing the upload, after all processing has 
been done and the file handle to the uploaded file has been closed, you can 
use the chmod function of PERL to give the uploaded file proper permissions.

Eg. let say the file you have uploaded is /tmp/001254_1.pdf

close(UP_FILE_HANDLE);

$cnt = chmod (0775, '/tmp/001254_1.pdf')

if ($cnt){ ## chmod worked!!
## Do soemthing here
}

Another alternative would be to write a admin script, that would delete 
these files for you. Since this script would also run under user wwwrite, 
you will not have any permissions issues to delete the file.

Hope that helps


>-rwxrwx---   1 www      wwwrite    71310 Jan  4 14:04 0012547_4.pdf*
>-rw-------   1 www      wwwrite    56694 Dec 21 13:01 001254_1.pdf
>-rwxr-x---   1 www      wwwrite  4040938 Dec 26 11:49 001254_2.pdf*
>
>
>Perhaps part of this problems lies with the fact I create direcories on the
>fly and put these files into them.
>
>any help would be appreciated,
>
>byron
>
>
>
>
>
>
>"When you sell a man a book, you don't sell him 12 ounces of paper and ink
>and glue - you sell him a whole new life." - Christopher Morley
>
>"Thanks O'REILLY." - Me
>
>
>
>
>
>_______________________________________________________
>Send a cool gift with your E-Card
>http://www.bluemountain.com/giftcenter/
>
>
>_______________________________________________
>Perl-Unix-Users mailing list. To unsubscribe go to 
>http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to