Home >Backend Development >PHP Tutorial >Question about uploading images based on local path in PHP?

Question about uploading images based on local path in PHP?

WBOY
WBOYOriginal
2016-08-18 09:15:281363browse

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?

Reply content:

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn