Comments (4)
我试试
from flysystem-cos.
补充一下:
1.listObjects理应带出目录(CommonPrefixes),但是没有
2.当bucket或者目录下只存在一个文件或者一个目录时,对应的Contents或者CommonPrefixes都为一维数组
CosAdapter.php:183
$response = $this->listObjects($this->applyPathPrefix($directory), $recursive);
dd($response);
//应追加目录
foreach ($response['CommonPrefixes'] ?? [] as $prefix) {
$list[] = $this->normalizeFileInfo([
'Key' => $prefix['Prefix'],
'Size' => 0,
'LastModified' => 0,
]);
}
正常情况
array:8 [
"Name" => "***"
"Prefix" => []
"Marker" => []
"MaxKeys" => "1000"
"Delimiter" => "/"
"IsTruncated" => "false"
"CommonPrefixes" => array:3 [
0 => array:1 [
"Prefix" => "test/"
]
1 => array:1 [
"Prefix" => "users/"
]
2 => array:1 [
"Prefix" => "usr/"
]
]
"Contents" => array:2 [
0 => array:6 [
"Key" => "main.hpp"
"LastModified" => "2021-03-01T15:01:25.000Z"
"ETag" => ""d9351288f15ab698f500dcfde0334d08""
"Size" => "2634"
"Owner" => array:2 [
"ID" => "1251114936"
"DisplayName" => "1251114936"
]
"StorageClass" => "STANDARD"
]
1 => array:6 [
"Key" => "t.sql"
"LastModified" => "2021-03-01T14:23:45.000Z"
"ETag" => ""413921e8eff9a594359755d4d99c4117""
"Size" => "156"
"Owner" => array:2 [
"ID" => "1251114936"
"DisplayName" => "1251114936"
]
"StorageClass" => "STANDARD"
]
]
]
异常情况
array:8 [
"Name" => "***"
"Prefix" => "usr/"
"Marker" => []
"MaxKeys" => "1000"
"Delimiter" => "/"
"IsTruncated" => "false"
"CommonPrefixes" => array:1 [
"Prefix" => "usr/uploads/"
]
"Contents" => array:6 [
"Key" => "usr/"
"LastModified" => "2019-02-28T09:03:33.000Z"
"ETag" => ""d41d8cd98f00b204e9800998ecf8427e""
"Size" => "0"
"Owner" => array:2 [
"ID" => "1251114936"
"DisplayName" => "1251114936"
]
"StorageClass" => "STANDARD"
]
]
from flysystem-cos.
listObjects理应带出目录(CommonPrefixes),但是没有
麻烦给我一下 #16 (comment) 的文件结构看看(多文件时)
from flysystem-cos.
listObjects理应带出目录(CommonPrefixes),但是没有
麻烦给我一下 #16 (comment) 的文件结构看看(多文件时)
上面贴的正常情况就是
array:8 [
"Name" => "***"
"Prefix" => []
"Marker" => []
"MaxKeys" => "1000"
"Delimiter" => "/"
"IsTruncated" => "false"
"CommonPrefixes" => array:3 [
0 => array:1 [
"Prefix" => "test/"
]
1 => array:1 [
"Prefix" => "users/"
]
2 => array:1 [
"Prefix" => "usr/"
]
]
"Contents" => array:2 [
0 => array:6 [
"Key" => "main.hpp"
"LastModified" => "2021-03-01T15:01:25.000Z"
"ETag" => ""d9351288f15ab698f500dcfde0334d08""
"Size" => "2634"
"Owner" => array:2 [
"ID" => "1251114936"
"DisplayName" => "1251114936"
]
"StorageClass" => "STANDARD"
]
1 => array:6 [
"Key" => "t.sql"
"LastModified" => "2021-03-01T14:23:45.000Z"
"ETag" => ""413921e8eff9a594359755d4d99c4117""
"Size" => "156"
"Owner" => array:2 [
"ID" => "1251114936"
"DisplayName" => "1251114936"
]
"StorageClass" => "STANDARD"
]
]
]
from flysystem-cos.
Related Issues (20)
- 获取预授权URL时过期时间错误 HOT 1
- getUploadOptions 方法语法错误 HOT 9
- v3 版本的 getUrl 方法会进行一次性 rawurlencode HOT 1
- v3 版本的 getUrl 方法会进行一次性 rawurlencode
- 上传超过1M文件 HOT 4
- flysystem v2 不再支持插件机制。 HOT 1
- laravel 9.0 默认 Flysystem:3.0 ,建议升级
- fileExists()文件不存在会抛出异常 HOT 1
- getUrl()只有半小时有效 HOT 4
- v3版本的SDK能否升级为2.0 HOT 4
- 大文件如何上传 HOT 3
- 不能在PHP8.1中使用 HOT 3
- 腾讯云里面的 url 并没有 app_id HOT 3
- 上传超过1M的文件 HOT 2
- 2.x版本 在 cos-php-sdk-v5 2.6.2 下报签名错误
- listObjects 方法获取失败 HOT 1
- league/flysystem与Thinkphp8.0里的冲突。安装不了 HOT 2
- 用 $flysystem->write 上传文件后,如何获取上传成功的路径? HOT 4
- visibility 方法有问题 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flysystem-cos.