基于阿里云云存储的一个简单下载页,支持目录,操作方便
演示地址: DEMO
获取object列表
function list_object($obj,$dir='',$bucket=BUCKET){ $options = array( 'delimiter' => '/', 'prefix' => $dir, 'max-keys' => 100, ); $response = $obj->list_object($bucket,$options); return $response->body; }
处理返回内容
// 处理目录 if(isset($list_object['CommonPrefixes'])){ foreach($list_object['CommonPrefixes'] as $s){ $prefix = is_array($s)?$s['Prefix']:$s; $file['path'] = "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF'].'?dir='.$prefix; $file['Prefix'] = $prefix; $dir_arr[] = $file; } } // 处理文件 if(isset($list_object['Contents'])){ foreach($list_object['Contents'] as $k=>$s){ if ($k!="0"){ $file['path'] = (get_sign_url($oss_sdk_service,$s['Key'])); $file['Key'] = str_replace($list_object['Contents']['0']['Key'],"",$s['Key']); $file['Size'] = formatter_size($s['Size']); $file_arr[] = $file; } } }

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Mac version
God-level code editing software (SublimeText3)
