Due to security issues involving both local and server aspects, based on input type="file "Page file upload in the form has always been in a very awkward position. On the one hand, users do not want their privacy to be leaked, so the browser cannot make effective judgments on the files selected by the user when uploading. On the other hand, for the sake of server-side security and reducing the transmission burden, the system hopes to reject illegal files before users start uploading.
Over time, uploading based on the original input method has become a legacy problem that network storage websites avoid, and it has also created all kinds of strange plug-ins and upload clients.
Is the input method of uploading so bad? Of course not. When uploading files is not large, it is still very simple and reliable. In PHP, we only need a composite form: Copy code The code is as follows: