Home > Article > Backend Development > PHP traditional file upload and Base64-bit file upload
1. Basic knowledge By using PHP’s global array $_FILES, you can upload files from the client computer to a 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"] - The 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.
2. Commonly used uploads
3. PHP reads and saves base64 encoded image content
|