Home > CMS Tutorial > Empire CMS > body text

How to save pictures remotely in Empire CMS

silencement
Release: 2019-11-27 13:52:24
forward
3182 people have browsed it

How to save pictures remotely in Empire CMS

The example in this article describes the method of remotely saving pictures by Empire CMS. Share it with everyone for your reference.

The specific implementation method is as follows:

The code is as follows:

<?php
function get_file($url,$folder,$pic_name){
set_time_limit(24*60*60); //限制最大的执行时间
$destination_folder=$folder?$folder.&#39;/&#39;:&#39;&#39;; //文件下载保存目录
$newfname=$destination_folder.$pic_name;//文件PATH
$file=fopen($url,&#39;rb&#39;);
if($file){
$newf=fopen($newfname,&#39;wb&#39;);
if($newf){
while(!feof($file)){
fwrite($newf,fread($file,1024*8),1024*8);
}
}
if($file){
fclose($file);
}
if($newf){
fclose($newf);
}
}
}
get_file("http://www.baidu.com/img/baidu_logo.gif","file","baidu.jpg");
?>
Copy after login

Recommended to study "Empire cms tutorial"

Supplement :

Solutions for the Imperial CMS verification code not being displayed:

When the Imperial CMS verification code is not displayed, you can try the following.

1. Re-modify the submission comment form

2. Remove all BOM headers from the page

3. Check the GD library of the server.

4. Remove the space between and press Enter

5. Clear the server and local machine cache

6. Backup the database in the background-repair Data table - Optimization data table

I hope this article will be helpful to everyone’s Imperial CMS website building.

The above is the detailed content of How to save pictures remotely in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:www.word666.com
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!