Question about uploading images based on local path in PHP?

WBOY
Release: 2016-08-18 09:15:28
Original
1283 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!