zoukankan      html  css  js  c++  java
  • 七牛 在线管理 v0.1

    <?php
    // @codingStandardsIgnoreFile
    require_once __DIR__.'/../vendor/autoload.php';
    
    use QiniuAuth;
      use QiniuStorageBucketManager;
    $accessKey = 'PkDMktpjk29Ag0n86_1mtF7zhX9f1RJCyHcgjnCI';
    $secretKey = '8gI2seqsKitvRn59CeOSgna_VyI82E2244JHmqj9';
    $testAuth = new Auth($accessKey, $secretKey);
    $bucketMgr = new BucketManager($testAuth);
    
    $bucket = 'iosios';
    $key = 'aaa.pdf';
    $prefix = $_GET['p'];
    
    $marker = '';
    $limit = 300;
    $dirs = array();
    $files = array();
    list($iterms, $marker, $err) = $bucketMgr->listFiles($bucket, $prefix, $marker, $limit);
    if ($err !== null) {
    } else {
        foreach ($iterms as $obj) {
            $sub = substr($obj["key"], strlen($prefix));
            //文件夹标记(可创建文件夹的)
            if($sub=="") { continue ;}
            
            //还有文件夹的
            if (strpos( $sub,"$")){
                $arr = explode("$", $sub);
                $dirs[$arr[0]]="";
    
            //没有文件夹了
            }else{
            $files[$sub]="";
            }
        }
    
    }
    ?>
    
    <!DOCTYPE html>
    <html>
    <head>
        <title>七牛数据管理</title>
    </head>
    <body>
    
    <?php
        if($prefix!=""){
    
     ?>
    <a href="#">返回上一页..</a><br><a href="#">返回首页</a><br><br><br>
    
    <?php } ?>
    
    
    
    
    
    </body>
    </html>
  • 相关阅读:
    div居中方法总结
    windows下配置nginx环境
    webpack+babel+react操作小结
    JavaScript数组常用操作总结
    MyBatis使用Generator自动生成代码
    如何上Chrome谷歌商店
    深入理解Spring IOC
    SpringMVC概要总结
    mybatis防止sql注入
    Redis和Memcache的区别分析
  • 原文地址:https://www.cnblogs.com/aliblogs/p/5827022.html
Copyright © 2011-2022 走看看