PHP下载mp3文件, 图片等到本地
//下载文件 $url = ‘http://xxx.com/99248982.mp3‘; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $rawdata = curl_exec($ch); curl_close($ch); $file_path = dirname(__FILE__) . ‘/temp/‘ . time() . ‘.mp3‘; $fp = fopen($file_path, ‘w‘); fwrite($fp, $rawdata); fclose($fp); // 上传到upyun $cdn = uploadToUpyun($file_path, ‘audio/‘ . date(‘Ymd‘), $info[‘uuid‘] . ‘.mp3‘);
相关推荐
zhangpan 2020-04-23
想个标题偏头痛 2020-04-09
LeoQ 2019-08-08
xiaxiaoyule 2013-06-20
移动视频探索者 2019-07-01
流萤 2019-06-28
mingrixing 2019-06-28
huzijia 2012-01-31
linvaluable 2015-09-25
SILENCEWCHEN 2012-10-16
85281245 2017-05-08
89447715 2012-07-06
89570195 2012-06-06
vianowu 2011-05-26
shao 2011-01-24
only0 2017-06-07
dengfan 2017-04-19
yjreset 2015-02-11
zhaojikun 2015-06-15