当前位置:网站首页>How micro engine uploads remote attachments
How micro engine uploads remote attachments
2022-06-25 04:52:00 【Kiway.】
First, configure the attachment settings of remote attachments , You can choose alicloud 、 Tencent cloud 、 Seven cattle .
1. First write a way to upload pictures to the remote
//..... Encapsulate this code in a method
public function doremoteupload($pathname)
{
// Remote upload code
global $_GPC, $_W;
load()->func('file');
//$pathname = 'images/6/2015/12/gT1aQZ5WA1UAZu58ntKUa1Rkw811K8.jpg';
if (!empty($_W['setting']['remote']['type'])) {
// Determine whether the system has enabled the remote attachment
$remotestatus = file_remote_upload($pathname); // Upload pictures to remote
if (is_error($remotestatus)) {
message(' Remote attachment upload failed , Please check the configuration and upload again ')
} else {
$remoteurl = tomedia($pathname); // Remote picture access URL
//$pathname // Local address to be stored and warehoused
}
}
}
2. Call the method in the interface processing of form submission
if (!empty($_GPC['img_list'])) {
// Remote upload
// $img_list= $_GPC['img_list'];
for($i = 0;$i<count($_GPC['img_list']);$i++){
$this->doremoteupload($_GPC['img_list'][$i]);
}
}
If not detailed , You can refer to micro engine . Look at the clouds :
Remote attachment
边栏推荐
- OOP栈类模板(模板+DS)
- Region of Halcon: generation of multiple regions (3)
- Opensea PHP development kit
- Fun CMD command line~
- How PHP gets the user's City
- 基于Cortex-M3、M4的精准延时(系统定时器SysTick延时,可用于STM32、ADuCM4050等)
- Record of the 25th week
- Codeforces Round #802 (Div. 2) C D
- Coordinate system left multiply right multiply
- 三角形类(构造与析构)
猜你喜欢

Kotlin Compose 监听软键盘 点击enter提交事件

Penetration test - directory traversal vulnerability

固態硬盤開盤數據恢複的方法

【FLink】access closed classloader classloader.check-leaked-classloader

「 每日一练,快乐水题 」1108. IP 地址无效化

在 .NET 6 中使用 dotnet format 格式化代码

以太网是什么要怎么连接电脑

为什么SQL语句命中索引比不命中索引要快?

Difference between asemi high power FET and triode

渗透测试-目录遍历漏洞
随机推荐
在 .NET 6 中使用 dotnet format 格式化代码
「 每日一练,快乐水题 」1108. IP 地址无效化
JDBC (IV)
ORA-00800: soft external error
Immutable學習之路----告別傳統拷貝
Vscode 设置clang-format
After the newly assigned variable of the applet is modified, the original variable will also be modified
融合CDN,为客户打造极致服务体验!
台式电脑连不上wifi怎么办
绝了!自动点赞,我用 PyAutoGUI!
Write shell script error summary
JS call() and apply()
两小时带你进入软件测试行业风口(附全套软件测试学习路线)
php开发支付宝支付功能之扫码支付流程图
Deep learning - several types of learning
Why does the SQL statement hit the index faster than it does not?
Qdebug June 2022
分布式websocket搭建方案
Upgrade PHP to php7 X (III) failure of wechat payment callback
The print area becomes smaller after epplus copies the template