当前位置:网站首页>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
边栏推荐
- What if win11 Bluetooth fails to connect? Solution of win11 Bluetooth unable to connect
- Record of the 25th week
- parallel recovery slave next change & parallel recovery push change
- 固態硬盤開盤數據恢複的方法
- Successfully solved: selenium common. exceptions. TimeoutException: Message: timeout: Timed out receiving message from
- JS arguments
- 分布式websocket搭建方案
- Kotlin Compose 监听软键盘 点击enter提交事件
- 2.0springmvc uses restful
- Swift rapid development
猜你喜欢

《牛客刷verilog》Part I Verilog快速入门

2.0springmvc uses restful

Teach you to write non maintainable PHP code step by step

File upload vulnerability shooting range upload labs learning (pass1-pass5)

leetcode1221. 分割平衡字符串

What if win11 Bluetooth fails to connect? Solution of win11 Bluetooth unable to connect

Kotlin Compose 完善toDo项目 Surface 渲染背景 与阴影

Startup mode of SoC verification environment

Vscode 设置clang-format

Concat() in JS
随机推荐
How do the defi protocols perform under this round of stress test?
Le chemin de l'apprentissage immutable - - Adieu à la copie traditionnelle
Xiaobai learns MySQL - Statistical 'opportunism'
JS, BOM, DOM (VI)
File upload vulnerability shooting range upload labs learning (pass1-pass5)
Vscode 设置clang-format
Virtual honeypot Honeyd installation and deployment
ORA-00800: soft external error
515. find the maximum value / Sword finger offer II 095 in each tree row Longest common subsequence
重磅直播 | 相移法+多频外差之数学原理推导+实现
PostgreSQL database Wal - RM_ HEAP_ ID logging action
Triangle class (construction and deconstruction)
JDBC (IV)
The consciousness of a programmer
【FLink】access closed classloader classloader.check-leaked-classloader
dotnet-exec 0.4.0 released
渗透测试-目录遍历漏洞
Wechat applet new version prompt update
Google Earth Engine(GEE)——全球JRC/GSW1_1/YearlyHistory数据集的批量下载(中国区域)
After the newly assigned variable of the applet is modified, the original variable will also be modified