Re: Help with file upload

From: Date: Thu, 16 Oct 2003 04:55:42 +0000
Subject: Re: Help with file upload
References: 1 2 3 4  Groups: php.db 
Request: Send a blank email to php-db+get-31043@lists.php.net to get a copy of this message
Bunmi Akinmboni wrote:
His is the new code: <?php if (is_uploaded_file($_FILES['ufile1']['tmp_name'])) {
    copy($_FILES['ufile1']['tmp_name'], ".");
You should be using move_uploaded_file() instead of copy(), first of all. Next, the two arguments passed to either copy() or move_uploaded_file() are _filenames_, not directories. So something like move_uploaded_file($_FILES['ufile1']['tmp_name'],'./' . $_FILES['ufile1']['name']); is probably what you're after. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.db (#31043) next »