Re: file upload failure

From: Date: Sat, 19 Apr 2003 09:26:19 +0000
Subject: Re: file upload failure
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-19493@lists.php.net to get a copy of this message
<?php // let's check it whether a file is uploadable or not if (is_uploaded_file($_FILES["userfile"]["tmp_name"])) { // display a file name echo "File Name: " . $_FILES["userfile"]["name"] . "<br>"; } else { echo "Possible file upload attack: filename " . $_FILES["userfile"]["name"]; } // and so on... ?> Vivek Kumar wrote:
Hi all, i am trying to upload files over ssl in PHP. The html code looks like this: <html> <head><title>A file upload form</title></head> <body> <center>This is a file upload form..</center> <form enctype="multipart/form-data" action="https://foobar.org/php/fileupload.php" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="30000"> Send this file : <input name="userfile" type="file"> <input type="submit" value="send file"> </form> </body> </html> and the PHP code like: <?php print_r($_FILES); print_r($HTTP_POST_FILES); echo "File Name: ",$_FILES['userfile']['name'],"<br>"; echo "File Type: ",$_FILES['userfile']['type'],"<br>"; echo "File Size: ",$_FILES['userfile']['size'],"<br>"; echo "File Tempname: ",$_FILES['userfile']['tmp_name'],"<br>"; echo "Upload Error: ",$_FILES['userfile']['error'],"<br>"; ?> but when i post the form after selecting the file i get the output like : Array ( ) Array ( ) File Name: File Type: File Size: File Tempname: Upload Error: I even tried it after removing the SSL but it didn't worked even then. I was not able to find out what is going wrong here. Is this a bug or something wrong with the code itself. I am using PHP-4.3.1-win32 manual install as an apache module, Apache-2.0.44-win32 with mod_ssl on Windows 2000. THX vivek kumar


« previous php.windows (#19493) next »