Home >Backend Development >PHP Tutorial >Question about uploading images based on local path in PHP?
It is known that there are several pictures in a local directory, and the local physical addresses of these pictures, such as: file:///C:/Users/Administrator/Desktop/test/data/Taobao/contentPic/dress collar splicing Linen skirt 16/1643805e-1.jpg
Is there a way in PHP to upload images through this physical path? Just upload local pictures to the server?
It is known that there are several pictures in a local directory, and the local physical addresses of these pictures, such as: file:///C:/Users/Administrator/Desktop/test/data/Taobao/contentPic/dress collar splicing Linen skirt 16/1643805e-1.jpg
Is there a way in PHP to upload images through this physical path? Just upload local pictures to the server?
If in this scenario, the user accesses the program through a browser, then it is not possible because the browser does not allow reading of Dingdi files
Try the 'CURLFILE' class,
$xx = new CURLFILE($filename, 'type', name');
It’s difficult to answer on the mobile phone
To paraphrase your question, there are images in a folder on the server. Can I use php to upload them to the server?
This is copying, not uploading.
Otherwise, it will be no different from ordinary upload, regardless of whether it is the same machine.