利用 PHP CURL zip压缩文件上传
2024-09-06 17:59:24
$postData['file'] = "@".getcwd()."/../attachment/qianbao/{$customer_id}.zip"; $this->log->info("Qianbao file path:".$postData['file']);
//$postData['sign'] = bin2hex(md5($str_sign)); //'file' => '@d:\usr\www\translate\document\Readme.txt'
//$postData['file'] = "@d:\home\oracle\xpay-1.0.0\attachment\qianbao\{$customer_id}.zip"; $postData['sign'] = md5($str_sign); $this->log->info("Qianbao Sign:".$postData['sign']); $postUrl = "http://www.happygrp.com/agent/merchant/import";//生产 $curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $postUrl);
curl_setopt($curl, CURLOPT_USERAGENT,'Opera/9.80 (Windows NT 6.2; Win64; x64) Presto/2.12.388 Version/12.15');
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // stop verifying certificate
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
//curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
$r = curl_exec($curl);
$e = curl_error($curl);
curl_close($curl);
最新文章
- lua-resty-websocket安装和测试
- Java内存回收机制
- MINIX3 进程调度分析
- Nginx 开启 path_info功能
- Factory Girl使用
- opencv china 网站,好1376472449
- Python LOGGING使用方法
- 《sift算法详解》阅读笔记
- eclispe 出现超内纯错误
- 读写锁ReadWriteLock和缓存实例
- 【USACO 2.1.4】荷斯坦奶牛
- hdu 2583 permutation 动态规划
- java虚拟机学习-JVM调优总结-调优方法(12)
- [HEOI2016]排序
- 如何在webpack中成功引用到图片?
- Linux基础命令---dmeg显示内核输出
- rebar3自动编译
- 并发修改异常(ConcurrentModificationException)
- go-restful 实现一个web server
- ChromeSwitchySharp代理设置步骤