This article uses Baidu Open cloud PHP SDK to achieve bulk download Baidu cloud disk files, need friends can refer to.
Baidu Open Cloud phpsdk download Address: http://developer.baidu.com/wiki/index.php?title=%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3%E9%A6%96% e9%a1%b5/web%e5%ba%94%e7%9 4%a8%e6%8e%a5%e5%85%a5/sdk Instance code: Code as follows: <?php/** * Author: HANKCS * Date  : 14-3-29 * time : Afternoon 10:29 */ini_set ("Max_execution_time", 36000); Require_once '.. /bcs.class.php '; Require_once '.. /krumo/class.krumo.php '; $host = ' bcs.duapp.com '; $ak = ' Your public key '; $sk = ' your private key '; $bucket = ' bucket name to download '; $baidu _bcs = new Baidubcs ($ak, $sk, $host); $response = Json_decode ($baidu _bcs->list_object ($bucket, Array (' Start ' => 0, ' limit ' => 1024,))->bod y); $downloaded _size = 0; while ($downloaded _size < $response->object_total) { Krumo ($response) //download them &NB Sp foreach ($response->object_list as $object) { if (! $object->is_dir) & nbsp { Mk_Dir ('. ') $object->parent_dir); $result = $baidu _bcs->get_object ($bucket, $object->object, Array ("Filew Riteto "=> '." $object->object)); } { $downloaded _size + = count ($response->object_list); $response = Json_decode ($baidu _bcs->list_object ($bucket, Array (' Start ' => $downloaded _size, ' Limit ' => 1024,))->body); } function Mk_dir ($dir, $mode = 0755) { if (Is_dir ($dir) | | @mkdir ($DIR, $mode)) return true; & nbsp if (!mk_dir (DirName ($dir), $mode)) return false; return @mkdir ($dir, $mode); }