I want to upload three pictures at the same time in one form, and upload them to three fields in the data table, namely preview1, preview2, preview3, but now only one picture can be uploaded. I would like to ask everyone for help. How should it be modified?
1. Front-end page
2. Backend code
< /p>
3. Database table
< /p>
Is it because there is no multiple attribute in your front-end input?
I suggest you write it in the form of asynchronous upload, then create three hidden inputs, and combine the uploaded image addresses and put them into the three inputs.
It is now very convenient to upload pictures asynchronously, unlike before.
If it is really not asynchronous, then you need to use a loop when processing on the backend, upload them one by one, and then combine the addresses and submit them to the database.
There is documentation here: http://document.thinkphp.cn/m...
Why not use asynchronous multi-image upload? Not only it’s easy to use, but also worry-free.