[PHP Upload] problem

From: Date: Mon, 25 Mar 2002 21:51:43 +0000
Subject: [PHP Upload] problem
Groups: php.general 
Request: Send a blank email to php-general+get-90164@lists.php.net to get a copy of this message
When running this code: <?php if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { copy($HTTP_POST_FILES['userfile']['tmp_name'], "C:\Inetpub\webpub\PHP\upload"); move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], "C:\Inetpub\webpub\PHP\upload"); } else { echo "Possible file upload attack. Filename: " . $HTTP_POST_FILES['userfile']['name']; } ?> .................. <form name="form1" method="post" action="upload.php" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="1000"> <p> <input type="file" name="userfile"> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> .................. I got this: Warning: Unable to create 'C:\Inetpub\webpub\PHP\upload': Permission denied in c:\Inetpub\webpub\PHP\upload.php on line 3 Warning: Unable to create 'C:\Inetpub\webpub\PHP\upload': Permission denied in c:\Inetpub\webpub\PHP\upload.php on line 4 Warning: Unable to move 'C:\WINDOWS\TEMP\php187.tmp' to 'C:\Inetpub\webpub\PHP\upload' in c:\Inetpub\webpub\PHP\upload.php on line 4 I must leave "register_globals=Off" !!! Can anyone help? Thanks, Evan

« previous php.general (#90164) next »