I think you have to specify the destination file name as well.  The
destination directory is not enough.

---
Seairth Jacobs
[EMAIL PROTECTED]


"Johnp" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to