This is driving me crazy. I'm trying to figure out how to upload a file. I've got two very simple files, yet it doesn't seem to work. This first is the file that allows the user to choose the file:
<html>
<head>
<title>File Upload Form</title>
</head>
<body>
This form allows you to upload a file to the server.<br>
<form action="getfile.php" method="post"><br>
Type (or select) Filename: <input type="file" name="uploadFile">
<input type="submit" value="Upload File">
</form>
</body>
</html>
</code>
The second is the php file that handles it:
<html>
<head>
<title>Process Uploaded File</title>
</head>
<body>
<?php
print_r($_FILES);
print "<P>
";
move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
"../blimages/site/7337/{$_FILES['uploadFile'] ['name']}")
?>
</body>
</html>
Since -- except for the print_r
-- I pulled these off a website tutorial on how to do a file upload, I'd think these files are okay.
The print_r($FILES)
return a completely empty array.
I also checked the php.ini
. File uploads are allowed, and the max size is 2M, which I assume is 2 megabytes, which is far larger than the file I've been trying to upload.
What else could be wrong?
Thanks,
Sean.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…