Upload wont work
| From: | Ragnar | Date: | Thu, 23 May 2002 09:43:05 +0000 |
| Subject: | Upload wont work | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98883@lists.php.net to get a copy of this message | ||
Hi and thanx for previous help!!!
Still a newbie ;)
I have tried to make the example from php manual working and have the
following code:
upload.html:
<form enctype="multipart/form-data" action="demo_up.php"
method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="512000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
demo_up.php:
<?php
function upload ()
{
if ( is_uploaded_file ($_FILES['userfile']['name'] ) )
{
copy($_FILES['userfile']['name'], "/demos/");
}
else
{
echo "File not uploaded: " . $_FILES['userfile']['name'];
}
}
?>
<?php
upload();
?>
This always ends up displaying "File not uploadet" + Filename. The file
doesnt seem to upload at all. Im using IIS 5.1 and latest version of php.
Any ideas?
Thanx!