Click to See Complete Forum and Search --> : File Upload Failing...


Wild Goose
08-17-2004, 06:50 PM
Hi Guys!

I'm not able to pick up file information from my file upload form page.

Here are samples of the code:
upload.html:
<html>
<body>
<h1>Upload new files:</h1>
<form enctype="multipart/form-data" action="upload.php"
method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
Upload this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>
</body>
</html>

upload.php:
<html>
<body>
<h1>Uploading file...<h1>
<?php
$userfile=$_FILE['userfile']['tmp'];
$userfile_name=$_FILE['userfile']['name'];
$userfile_size=$_FILE['userfile']['size'];
$userfile_type=$_FILE['userfile']['type'];
$userfile_error=$_FILE['userfile']['error'];
echo "<p>File name: ".$userfile."</p>";
?>
</body>
</html>

When upload.php runs the $_FILE variables are empty.

Does anyone have any ideas?

Thanks!

Wild Goose
08-17-2004, 08:22 PM
Hi Guys,

I've looked at the code again and I see I've got some syntax errors. I've fixed then and it seems to work.

Sorry about the mix up!