php - $_FILES empty when trying to do a file upload -
This is driving me crazy. I am trying to figure out how to upload a file. I've got two very simple files, yet it does not seem to work, this is the first file that allows the user to choose the file:
& Lt; Form action = "getfile.php" method = "post" & gt; & Lt; Br> Type (or select) file name: & lt; Input type = "file" name = "upload file" & gt; & Lt; Input type = "submit" value = "upload file" & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt; & Lt; / Code & gt;
The second is the php file that handles it:
& lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Process uploaded file & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php print_r ($ _ files); Print "& lt; P & gt; \ n"; Move_uploaded_file ($ _FILES ['uploadfile'] ['tmp_name'], "../blimages/site/7337/{$_FILES[uploadFile '] [' name ']}")? & Gt; & Lt; / Body & gt; & Lt; / Html & gt; Since - except print_r
- I have pulled from a file tutorial that how do I upload a file, I think these files are OK
print_r ($ FILES)
returned a completely empty array.
I also examined php.ini
. File uploads are allowed, and the maximum size is 2M, which I believe is 2 megabytes, which is larger than the file I am trying to upload.
What else can be wrong?
Thanks,
Sean.
Add appropriate antipyte attribute to your form
Pre> Also, make sure there is no space between your brackets when you use multi-dimensional arrays: & form; Form action = "getfile.php" method = "post" enctype = "multipart / form-data" & gt; Here's the document:
$ _FILES ['uploadfile'] ['tmp_name']
Comments
Post a Comment