PHP file upload

I have a problem downloading files in PHP. When I submit, $ _FILES [] is empty. I feel this is such a question n00b: /

My form:

<form method="post" action="uploadfile.php"> <input type="hidden" name="MAX_FILE_SIZE" value="300000" /> Image: <input name="ImageFile" type="file" /><br /> <input type="submit" value="Add Image" /><br /> </form> 

Relevant php.ini:

  ;;;;;;;;;;;;;;;;;;;;;
 ;  File uploads
 ;;;;;;;;;;;;;;;;;;;;;

 ;  Whether to allow HTTP file uploads.
 file_uploads = On

 ;  Temporary directory for HTTP uploaded files (will use system default if not
 ;  specified).
 upload_tmp_dir = "c: \ php5 \ upload \"

 ;  Maximum allowed size for uploaded files.
 upload_max_filesize = 300M

c: \ php5 \ upload \ is writable via IUSR_HOSTNAME

Any thoughts on what else I should check?

+6
html file php upload file-upload
source share
1 answer

Make sure your form tag has this attribute: enctype="multipart/form-data"

Without it, files will not be uploaded.

+14
source share

All Articles