This PHP file upload class is mainly used to upload files, including pictures, videos, and word documents. In fact, it is recommended to use it to process pictures. The main reason for recommendation is that this class is very standardized, and basically all upload parameters are They can all be defined in the class without modification in php.ini
Instructions for use:
By using PHP's global array $_FILES, you can upload files from the client computer to the remote server. The first parameter is the input name of the form, and the second subscript can be "name", "type", "size" ", "tmp_name" or "error".
like this:
$_FILES["file"]["name"] - The name of the uploaded file
$_FILES["file"]["type"] - The type of file being uploaded
$_FILES["file"]["size"] - Size of the uploaded file, in bytes
$_FILES["file"]["tmp_name"] - The name of the temporary copy of the file stored on the server
$_FILES["file"]["error"] - Error code caused by file upload
This is a very simple way to upload files. For security reasons, you should add restrictions on who has permission to upload files.
All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn
Related Article
29 Jul 2016
asp file upload: asp file upload php file upload class code: Copy the code as follows: <?php /** * File upload class */ class uploadFile { public $max_size = '1000000';//Set the upload file size public $file_name = 'date';//The renaming method represents naming based on time, and others use the given name public $allow_types;//The file extensions allowed to be uploaded, different file types are separated by "|" public $
12 Jul 2016
A complete PHP file upload class example explanation. A complete PHP file upload class example is explained. This file upload class can customize the upload file size, upload file type and file storage address. There is a problem during use.
13 Jul 2016
PHP file upload class PHP file upload code. A simple PHP file upload class, an image processing class discovered when sorting out PHP classes. There are already many classes for PHP to process images, including those that process images individually, and some that add watermarks.
20 Jul 2016
PHP file upload (powerful file and image upload class). PHP file upload (powerful file and picture upload class) This practical code for file upload can easily upload files or pictures you specify, and can also quickly limit the upload of picture file types.
Hot Tools
Powerful php file upload class
Powerful php file upload class
PHP multi-file upload class that supports watermarks, dates, and thumbnails
PHP multi-file upload class that supports watermarks, dates, and thumbnails
PHP supports single or multiple file upload classes
PHP supports single or multiple file upload classes