Re: Help with file upload

From: Date: Thu, 16 Oct 2003 04:32:14 +0000
Subject: Re: Help with file upload
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31040@lists.php.net to get a copy of this message
Bunmi Akinmboni wrote:
Pls Help. I have done a lot of reading prior to this yet I just can't seem make it work. I wrote an upload program as seen below but the response I got was: Possible file upload attack. Filename: ayservenet.jpg Array ( [ufile1] => Array ( [name] => ayservenet.jpg [type] => image/pjpeg [tmp_name] => /tmp/phpIMEhdh [error] => 0 [size] => 3030 ) ) [snip]
if (is_uploaded_file($_FILES['ufile1']['name'])) {
    copy($_FILES['ufile1']['name'], ".");
    echo "$ufile1_name ";
    echo "DONE";
    echo " ";
    print_r($_FILES);
} else {
    echo "Possible file upload attack. Filename: " . $_FILES['ufile1']['name'];
    echo " ";
    print_r($_FILES);
} ?>
You should pass $_FILES['ufile1']['tmp_name'] to is_uploaded_file(). -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.db (#31040) next »