[thelist] Need help with Perl upload code and password protected directory

Amy Johnson amy at rocky-hills.com
Fri Jan 9 22:43:50 CST 2004


I have the following code I use to upload files to a UNIX system.  

    $POST_MAX=-1;   ## controls how many bytes a user is allowed to
upload (neg is unlimited)
    open (SAVE,">$rptdir$finalfile");
    binmode SAVE;
    while (read($file,$data,1024)) {
      print SAVE $data;
    }
    close SAVE; 


I would like to be asked for a password before uploading to the
writeable directory.  But I don't want to be asked for a password when
downloading.  The directory is set to 777.  I have the .htaccess file
set up as below.  But it doesn't ask me for a password and allows the
code to write to the directory with no problems.  Any suggestions about
how to get the directory password protected for uploading files would be
appreciated.  Thanks! Amy

============.htaccess file============

AuthUserFile /usr/blah/blah/blah/.htpasswd
AuthGroupFile /dev/null
AuthName ByPassword
AuthType Basic

<Limit PUT>
require user water
</Limit>

<Limit GET>
allow from all
</Limit>          




More information about the thelist mailing list