How to upload files in php: first get the content of the uploaded file from the form; then paste the code for uploading the file; finally, convert the format encoding of the file name into [utf-8].
php method to upload files:
1, first get the uploaded file content from the form:
Note: When uploading files, the attributes of the form must be added enctype="multipart/form-data"
##$filedata = $_FILES ['file'];
$filename = $filedata['name']; move_uploaded_file($filedata['tmp_name'],'/uploads/file/'.$filename);
$filename = iconv('utf-8','gb2312',$filename);
Relevant learning recommendations:php programming (video)
The above is the detailed content of How to upload files in php. For more information, please follow other related articles on the PHP Chinese website!