Home > Article > Backend Development > How to access the download link and save the downloaded file in php
Description:
#A download link on the Internet. When accessed in the browser, a picture will be downloaded. How to use it here? PHP script, access this link, and then save the downloaded image to the local specified folder?
Note: Use a script to access the link, and then save the file returned by the link. This has nothing to do with the browser.
Online learning video tutorial sharing: php video tutorial
##Picture link: https://clarks .scene7.com/is/image/clarks/download/26085012_A
$s = file_get_contents('https://clarks.scene7.com/is/image/clarks/download/26085012_A'); $path = './a.jpeg'; //文件路径和文件名 file_put_contents($path, $s);Related article tutorial recommendation:
The above is the detailed content of How to access the download link and save the downloaded file in php. For more information, please follow other related articles on the PHP Chinese website!