Re: Can someone - anyone see my error?

From: Date: Mon, 26 Aug 2002 00:16:20 +0000
Subject: Re: Can someone - anyone see my error?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-114087@lists.php.net to get a copy of this message
I think you have to specify the destination file name as well. The destination directory is not enough. --- Seairth Jacobs seairth@seairth.com "Johnp" <aerc@aerc.biz> wrote in message news:20020825215615.68241.qmail@pb1.pair.com... Ok after being blasted for not looking on PHP.net first I have now returned none the wiser! :D Here is the post file: --------------------------------- <form enctype="multipart/form-data" action="postbit.php" method="post"> <input type="hidden" name="5400" value="1000"> Send this file: <input name="userfile" type="file"> <input type="submit" value="Send File"> </form> Here is the post handler file: ---------------------------------------- <?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/thehobby/public_html/php/phpforums/uploads/"); } else { echo "Possible file upload attack. Filename: " . $_FILES['userfile']['name']; } /* ...or... */ move_uploaded_file($_FILES['userfile']['tmp_name'], "/home/thehobby/public_html/php/phpforums/uploads/"); ?> And here is the error I get: ------------------------------------- Warning: Unable to create '/home/thehobby/public_html/php/phpforums/uploads/': Is a directory in /home/thehobby/public_html/php/phpforums/forums/postbit.php on line 4 Warning: Unable to create '/home/thehobby/public_html/php/phpforums/uploads/': Is a directory in /home/thehobby/public_html/php/phpforums/forums/postbit.php on line 9 Warning: Unable to move '/tmp/phpahcXwh' to '/home/thehobby/public_html/php/phpforums/uploads/' in /home/thehobby/public_html/php/phpforums/forums/postbit.php on line 9 Anyone know whats going on - PHP.net was of a absolutely no use and I am very new at file uploads - any help appreciated! Thanks - John

« previous php.general (#114087) next »