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.'/':''; //文件下载保存目录 $newfname=$destination_folder.$pic_name;//文件PATH $file=fopen($url,'rb'); if($file){ $newf=fopen($newfname,'wb'); 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"); ?>
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SublimeText3 Linux new version
SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver CS6
Visual web development tools