According to the picture upload written by the tp5 framework, let’s
not say much, see the effect.
First, render the template in the controller and create a new
file in index.html. index.html. Note that enctype="multipart/form-data" must be filled in the form. By default, the value of enctype is application/x-www-form-urlencoded, which cannot be used for file upload. Only when multipart/form-data is used can the file data be completely transmitted.
The upload is successful and the picture is displayed. Welcome to technical exchanges