You can directly use move_uploaded_file ($ _ FILES [quot; filenamequot;] [quot; tmp_namequot;] to upload images and FILES in php... you can use move_uploaded_file ($ _ FILES ["filename"] ["tmp_name"] to upload images and FILES in php, next I will share with you an example of the webmaster sharing file upload.
Knowledge points to be learned in the early stage
Move_uploaded_file () file upload function
If (move_uploaded_file ($ _ FILES ["filename"] ["tmp_name"]) {echo 'file uploaded successfully ';}
$ _ FILES php global variables
$ _ FILES: variables submitted to the script by uploading the http post file. Similar to the old array $ HTTP_POST_FILES array (still valid, but not used)
$ _ FILES ['myfile'] ['name'] original name of the client file. $ _ FILES ['myfile'] ['type'] indicates the MIME type of the file, which must be supported by the browser, for example, "image/gif ". $ _ FILES ['myfile'] ['size'] size of the uploaded file, in bytes. $ _ FILES ['myfile'] ['tmp _ name'] temporary file name stored on the server after the file is uploaded, which is generally the default file name. It can be specified in upload_tmp_dir of php. ini, but the putenv () function setting does not work. $ _ FILES ['myfile'] ['error'] error code related to the file upload. ['Error'] is added in PHP 4.2.0. The following is its description: (they become constants after PHP3.0) UPLOAD_ERR_ OK value: 0; no error occurs, and the file is uploaded successfully. UPLOAD_ERR_INI_SIZE: 1; the uploaded file exceeds the limit of the upload_max_filesize option in php. ini. UPLOAD_ERR_FORM_SIZE value: 2; the size of the uploaded file exceeds the value specified by the MAX_FILE_SIZE option in the HTML form. UPLOAD_ERR_PARTIAL value: 3; only part of the file is uploaded. UPLOAD_ERR_NO_FILE value: 4; no file is uploaded. Value: 5; the size of the uploaded file is 0.
Core files:
Upimg.htm
Upload images