config.php
2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
return [
/**
* 图片上传配置
*/
'upload_img' => [
//验证
'rule' => [
'size' => 3 * 1024 * 1024, //大小限制
'ext' => 'jpeg,jpg,png,gif', //文件类型限制
],
//生成文件规则
'savename' => 'uniqid',
//缩略图缓存路径(可删除)
'cache' => ROOT_PATH . 'runtime/images/',
//设置静态缓存参数(304)
'header_cache' => [
'Cache-Control' => 'max-age=2592000',
'Pragma' => 'cache',
'Expires' => "%Expires%", // cache 1 month
'etag' => "%etag%",
'Last-Modified' => "%Last-Modified%",
'Content-Description' => 'File Transfer',
],
//图片保存根路径
'path' => './uploads/images/',
//图片上传变量名
'name' => 'image',
],
/**
* 文件上传配置
*/
'upload_file' => [
//验证
'rule' => [
'size' => 50 * 1024 * 1024, //大小限制
],
'cache' => ROOT_PATH . 'runtime/file/',
//生成文件规则
'savename' => 'uniqid',
'header_cache' => [
'Accept-Ranges' => 'bytes',
'Cache-Control' => 'public',
'Pragma' => 'cache',
'Expires' => "%Expires%", // cache 1 month
'etag' => "%etag%",
'Last-Modified' => "%Last-Modified%",
],
//文件保存根路径
'path' => './uploads/files/',
//文件上传变量名
'name' => 'file',
//压缩文件临时保存根路径
'temp_path' => ROOT_PATH . 'runtime/file/',
//mime限制
// 'mime_type' => ['video/x-ms-asf', 'application/octet-stream', 'audio/mp4', 'audio/x-flac', 'audio/mpeg', 'audio/x-wav'],
],
/**
* 文件上传配置
*/
'upload_audio' => [
//验证
'rule' => [
'size' => 50 * 1024 * 1024, //大小限制
],
'cache' => ROOT_PATH . 'runtime/file/',
//生成文件规则
'savename' => 'uniqid',
'header_cache' => [
'Accept-Ranges' => 'bytes',
'Cache-Control' => 'public',
'Pragma' => 'cache',
'Expires' => "%Expires%", // cache 1 month
'etag' => "%etag%",
'Last-Modified' => "%Last-Modified%",
],
//文件保存根路径
'path' => './uploads/files/',
//文件上传变量名
'name' => 'file',
//压缩文件临时保存根路径
'temp_path' => ROOT_PATH . 'runtime/file/',
],
];