I have updated my script as follows but it still doesn't seem to work:

<?php
$uploadpath = "/home/sites/site176/web/makeit";
if($userfile) {
move_uploaded_file ($_FILES ['userfile'], "$uploadpath/$userfile_name");

echo $userfile_name;
echo "Successfully Added!<br>\n";
//$username : contains the name of TMP file, $usrfile_name : it's the real
name of file
}
?>
<form enctype="multipart/form-data" action="<?php echo $PHP_SELF ?>"
method="post" name="upload">
File to Upload: <input type=file name=userfile><BR>
<input type=submit value="Upload">
</form>


I get the message that the file has been successfully added, but when I
check the location the file doesn't exsit.

Any more ideas??

Tom



"Rich Gray" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> >   <?php
> > if($userfile) {
> > copy($userfile, '/home/sites/site176/web/makeit/$userfile_name');
> >  echo "Successfully Added!<br>\n";
> > }
> > ?>
> > <form action="<?php echo $PHP_SELF ?>" method="post" name="upload">
> > File to Upload: <input type=file name=userfile><BR>
> > <input type=submit value="Upload">
> > </form>
>
> Hi Tom
>
> Here's some quick comments..
>
> . You need enctype="multipart/form-data" on your form for file uploads
> . Watch out for max file size being exceeded -- check the php manual on
> 'Handling file uploads'
> . If register_globals is off on your server you'd better start looking at
> using the $_FILES superglobal (check the manual)
> . use move_uploaded_file(...) rather than copy(...)
>
> HTH
> Rich


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

Reply via email to