-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilesUploadConfig.php
More file actions
51 lines (45 loc) · 1.76 KB
/
FilesUploadConfig.php
File metadata and controls
51 lines (45 loc) · 1.76 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
<?php
/**
* @Author: pizepei
* @ProductName: PhpStorm
* @Created: 2019/4/1 22:25
* @title 文件上传配置
*/
namespace normphp\config;
class FilesUploadConfig
{
/**
* 计划
* 文件上传以应用为授权单位 每个应用可以有多个授权域名
* 签名 首先前端请求后端 获取签名(请求参数域名+appid) 返回sha1(域名+appid+AppSecret+时间戳+随机字符串)+时间戳+随机字符串
* 文件被上传时 会根据域名创建目录(分布式可同时上传到所有服务器上) 在被请求时由nginx获取域名定位到域名目录下(没有绑定域名的就没有目录了)
*/
CONST FILES_UPLOAD_APP = [
'asdkjlk3434df674545l'=>[
'appid'=>'asdkjlk3434df674545l',//以appid为分组名称 (目录名称)
'AppSecret'=>'asdkjlsssfk3434df67455656345l',
'token'=>'68uijkmsd454lfgjuwynvcv@',
'period'=>20,//分钟单位
'request_domain'=>[
'/^http:\/\/[A-Za-z0-9_-]+.oauth.heil.top/S',//通配符域名
'/^http:\/\/oauth.heil.top/S',//标准域名
],//支持的来源域名 正则表达式
'show_domain'=>[
'http://oauth.heil.top',
'https://oauth.heil.top',
],
'catalogue'=>'..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'files_upload'.DIRECTORY_SEPARATOR,//文件根目录
]
];
/**
* 模式
*/
CONST FILES_UPLOAD_APP_SCHEMA = [
'files-upload'=>[
'type'=>[
'image/png',
],//支持的文件格式
'size'=>(1024*1024),//默认1M
],
];
}