HTTP Upload doesn't work
| From: | Marcel van Leeuwen | Date: | Sat, 11 Aug 2001 11:43:09 +0000 |
| Subject: | HTTP Upload doesn't work | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-8779@lists.php.net to get a copy of this message | ||
Hi,
I'm using PHP 4.06 on windows 2000 professional.
I made a simple script to upload a file and move or copy it.
But it doesn't work
This is the form which sends the file:
<form name="FormName" method="post" action="jobupload.php"
enctype="multipart/form-data">
<?php
include ("calc/hidden.inc");
?>
If you agree with these costs select the file and
upload it, else go back and change some options.<br>
<input type="hidden" name="MAX_FILE_SIZE"
value="1000000">
<input type="file" name="userfile" size="16"><br>
<input type="submit" name="submitButtonName"
value="Upload">
</form>
This is jobupload.php (body part):
<body bgcolor="#ffffff">
<?php
$userfile = $HTTP_POST_FILES['userfile']['name'];
$filenameremote = $HTTP_POST_FILES['userfile']['tmp_name'];
$k2 = $HTTP_POST_FILES['userfile']['size'];
$k3 = $HTTP_POST_FILES['userfile']['type'];
echo $userfile."<br>";
echo $filenameremote."<br>";
echo $k2."<br>";
echo $k3."<br>";
//if(is_uploaded_file($userfile))
//if($userfile and is_uploaded_file($k3))
/*
if(is_uploaded_file($k3))
{
echo "Great";
}
else
{
echo "error";
}
*/
?>
<p></p>
</body>
All the file variables are good, and printed correctly.
How can I fix this problem?
Thanks
Marcel van Leeuwen
Netherlands