The problem of uploading pictures by file_put_contents ()

problem description

the front end uses ajax to send the picture in base64 format, which can be saved successfully, but somehow one more picture is generated.

related codes

   

Php
Apr.01,2021

judging from the name of the picture, the front end should have initiated multiple requests to cause

.

you can check whether the network in the browser debugger initiates multiple requests


agrees with the upstairs view that the two file names you generated are already different. It must be caused by multiple requests.


agree to the upstairs. Limit the front end to a refresh and submit it, or you restrict it in the background

.
Menu