It drives me crazy. I am trying to figure out how to upload a file. I have two very simple files, but it does not seem to work. This is the first file that allows the user to select a 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 a php file that processes it:
<html> <head> <title>Process Uploaded File</title> </head> <body> <?php print_r($_FILES); print "<P>\n"; move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'], "../blimages/site/7337/{$_FILES['uploadFile'] ['name']}") ?> </body> </html>
Since - with the exception of print_r - I pulled them out of a website tutorial on how to download a file, I think these files are fine.
print_r($FILES) returns a completely empty array.
I also checked php.ini . File permissions are allowed, and the maximum size is 2 M, which I assume is 2 megabytes, which is much larger than the file I was trying to upload.
What else could be wrong?
Thanks,
Sean.
php
Sean
source share