File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 12
12
* [ read] ( #read ) 读取云存储文件/目录内容
13
13
* [ has] ( #has ) 判断文件是否存在于又拍云存储
14
14
* [ info] ( #info ) 获取云存储文件/目录的基本信息
15
+ * [ getMimetype] ( #getMimetype ) 获取云存储文件类型
15
16
* [ delete] ( #delete ) 删除文件或者目录
16
17
* [ createDir] ( #createdir ) 创建目录
17
18
* [ deleteDir] ( #deletedir ) 删除文件或者目录
@@ -184,7 +185,7 @@ Upyun::has( string $path )
184
185
获取云存储文件/目录的基本信息
185
186
186
187
``` php
187
- Upyun::info( string $path )
188
+ Upyun::info( string $path, array $otherHeaders )
188
189
```
189
190
190
191
@@ -196,16 +197,44 @@ Upyun::info( string $path )
196
197
- ** string** ` $path `
197
198
云存储的文件路径
198
199
200
+ - ** string** ` $otherHeaders `
201
+ 设置了后,方法将返回其他 http header 中的信息,默认为空
199
202
200
203
** 返回值:**
201
204
202
- 返回一个数组,包含以下 key
205
+ 返回一个数组,默认包含以下 key
203
206
- ` x-upyun-file-type ` 当 $path 是目录时,值为 * folder* ,当 $path 是文件时,值为 * file* ,
204
207
- ` x-upyun-file-size ` 文件大小
205
208
- ` x-upyun-file-date ` 文件的创建时间
206
209
207
210
208
211
212
+ ---
213
+
214
+ ### getMimetype
215
+
216
+ 获取云存储文件的文档类型
217
+
218
+ ``` php
219
+ Upyun::getMimetype( string $path )
220
+ ```
221
+
222
+
223
+
224
+
225
+ ** 参数列表:**
226
+
227
+
228
+ - ** string** ` $path `
229
+ 云存储的文件路径
230
+
231
+
232
+ ** 返回值:**
233
+
234
+ 文档类型,e.g: ` appcation/json ` ,获取失败返回空字符串
235
+
236
+
237
+
209
238
---
210
239
211
240
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ public function has($path)
173
173
* @param string $path 云存储的文件路径
174
174
* @param array $otherHeaders 设置了后,方法将返回其他 http header 中的信息,默认为空
175
175
*
176
- * @return array 返回一个数组,包含以下 key
176
+ * @return array 返回一个数组,默认包含以下 key
177
177
* - `x-upyun-file-type` 当 $path 是目录时,值为 *folder*,当 $path 是文件时,值为 *file*,
178
178
* - `x-upyun-file-size` 文件大小
179
179
* - `x-upyun-file-date` 文件的创建时间
@@ -189,7 +189,7 @@ public function info($path, $otherHeaders = array())
189
189
/**
190
190
* 获取文件的文档类型
191
191
* @param string $path 云存储文件路径
192
- * @return string 文档类型,获取失败返回空字符串
192
+ * @return string 文档类型,e.g: `appcation/json`, 获取失败返回空字符串
193
193
*/
194
194
public function getMimetype ($ path )
195
195
{
You can’t perform that action at this time.
0 commit comments