腾讯对象存储PHP实践之上传 php 创建对象 php面向对象练习题 php json对

php教程评论475 views阅读模式

贴代码先

 $file_name = 'test.jpg'; $upload_url = 'web.file.myqcloud.com/files/v1/10039609/wechat/cover/' . $file_name; $exp = time() + 600; $sign = 'a=10039609&b=wechat&k=AKIDqybsVwxcwSeGYJTsLElPdjgFGa5aPGso&e=' . $exp . '&t=' . time() . '&r=' . rand() . '&f=/10039609/wechat/cover/' . $file_name; $sign = base64_encode(hash_hmac('SHA1', $sign, 'prbaqNGhrNinShbRWXqfT10wpCFs68hu', true) . $sign); $post_data = [ 'op' => 'upload', 'filecontent' => file_get_contents('https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo_top_ca79a146.png'), // baidu logo]; $header = [ 'Content-Type: multipart/form-data', 'Authorization: ' . $sign, ]; $ch = curl_init($upload_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); $res = curl_exec($ch); echo'

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介绍了腾讯对象存储PHP实践之上传,包括了php,对象方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

    ';
    print_r(json_decode($res, true));

    企鹅博客
    • 本文由 发表于 2020年8月26日 19:49:21
    • 转载请务必保留本文链接:https://www.qieseo.com/323008.html

    发表评论