RE: [PHP] Upload file - $HTTP_POST_FILES empty (thinking in harakiri)

From: Date: Sat, 24 Aug 2002 07:09:09 +0000
Subject: RE: [PHP] Upload file - $HTTP_POST_FILES empty (thinking in harakiri)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113906@lists.php.net to get a copy of this message
Try these two things: 1) remove this line from the form: <input type="hidden" name="MAX_FILE_SIZE" value="2000000"> 2) try juts putting this in the upload.php page. if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { copy($_FILES['userfile']['tmp_name'], "/home/juque/public_html/VI_eaf/upload/".$_FILES['userfile']['name']); } else { echo "Possible file upload attack. Filename: " . $_FILES['userfile']['name']; } -Naintara -----Original Message----- From: php-general-return-113889-naintara=del6.vsnl.net.in@lists.php.net [mailto:php-general-return-113889-naintara=del6.vsnl.net.in@lists.php.ne t]On Behalf Of Zeev Suraski Sent: Saturday, August 24, 2002 8:49 AM To: Juan Pablo Aqueveque Cc: php-general@lists.php.net Subject: Re: [PHP] Upload file - $HTTP_POST_FILES empty (thinking in harakiri) What is your upload directory? What platform is it? Did you try taking a look at the Apache error log? Zeev At 17:05 23/08/2002, Juan Pablo Aqueveque wrote: >Hi guys!.. i'm really grief-stricken. >I had spend all the morning looking for solution to my problem, PLEASE.. >Could somebody help me? ' -(. >I tried the example from >http://www.php.net/manual/en/features.file-upload.php but i get >the >message "Possible file upload attack", I notice that this message is >because $HTTP_POST_FILES was absolutely empty.. BUT i don't know WHY is >empty!!!!!!! > >- My form.php file are: ><form enctype="multipart/form-data" action="upload.php" >method="post"> ><input type="hidden" name="MAX_FILE_SIZE" value="2000000"> >Send this file: <input name="userfile" type="file"> ><input type="submit" value="Send File"> ></form> > >- My upload.php file are: > ><?php >// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of >$_FILES. >if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { > copy($_FILES['userfile']['tmp_name'], > "/home/juque/public_html/VI_eaf/upload/"); >} else { > echo "Possible file upload attack. Filename: " . > $_FILES['userfile']['name']; >} >/* ...or... */ >move_uploaded_file($_FILES['userfile']['tmp_name'], >"/home/juque/public_html/VI_eaf/upload/"); >?> > >- My php.ini file_uploads = On > >- My upload directory had 777 permission. > >- My upload file is a simple .txt of 32 Bytes. > >- PHP 4.1.2 / Apache 1.3.23 > >- I have changed HTTP_POST_FILES for $_FILES > >Please GUYS.. any idea will be really appreciate. > >--jp > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#113906) next »