upload.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. return [
  12. //默认上传模式,后台配置优先,添加类型一定索引要和驱动名一致 用小写字母
  13. 'default' => 'local',
  14. //上传文件大小 50M
  15. 'filesize' => 52428800,
  16. //上传文件后缀类型
  17. 'fileExt' => ['jpg', 'jpeg', 'png', 'gif', 'pem', 'mp3', 'wma', 'wav', 'amr', 'mp4', 'key', 'xlsx', 'xls', 'txt', 'ico', 'crt', 'webp', 'zip'],
  18. //上传文件类型
  19. 'fileMime' => [
  20. 'image/jpg',
  21. 'image/jpeg',
  22. 'image/gif',
  23. 'image/png',
  24. 'text/plain',
  25. 'audio/mpeg',
  26. 'video/mp4',
  27. 'application/octet-stream',
  28. 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  29. 'application/vnd.ms-works',
  30. 'application/vnd.ms-excel',
  31. 'application/zip',
  32. 'text/xml',
  33. 'image/x-icon',
  34. 'image/vnd.microsoft.icon',
  35. 'application/x-x509-ca-cert',
  36. 'image/webp',
  37. 'application/x-zip-compressed',
  38. // 补充缺失
  39. 'audio/x-ms-wma', // wma
  40. 'audio/wav', // wav
  41. 'audio/amr', // amr
  42. 'application/x-pem-file', // pem
  43. // Windows 兼容
  44. 'audio/mp3', // mp3 Windows
  45. 'audio/wave', // wav Windows Chrome
  46. 'audio/x-wav', // wav Windows IE/Edge
  47. 'application/msexcel', // xls Windows
  48. ],
  49. //驱动模式,此配置优先与后台配置,后台添加配置请加前缀,例如添加七牛云配置:accessKey 后台添加变量名 qiniu_accessKey
  50. 'stores' => [
  51. //本地上传配置
  52. 'local' => [],
  53. //七牛云上传配置
  54. 'qiniu' => [
  55. 'AccessKeyId' => '', // sys_config('qiniu_accessKey')
  56. 'AccessKeySecret' => '', // sys_config('qiniu_secretKey')
  57. ],
  58. //oss 阿里云上传配置
  59. 'oss' => [
  60. 'AccessKeyId' => '', // sys_config('accessKey')
  61. 'AccessKeySecret' => '', // sys_config('secretKey')
  62. ],
  63. //cos 腾讯云上传配置
  64. 'cos' => [
  65. 'AccessKeyId' => '', //sys_config('tengxun_accessKey')
  66. 'AccessKeySecret' => '', //sys_config('tengxun_secretKey')
  67. 'APPID' => '', //sys_config('tengxun_appid')
  68. ],
  69. //oss 京东云
  70. 'jdoss' => [
  71. 'AccessKeyId' => '', // sys_config('accessKey')
  72. 'AccessKeySecret' => '', // sys_config('secretKey')
  73. ],
  74. //oss 华为云
  75. 'obs' => [
  76. 'AccessKeyId' => '', // sys_config('accessKey')
  77. 'AccessKeySecret' => '', // sys_config('secretKey')
  78. ],
  79. //oss 天翼云
  80. 'tyoss' => [
  81. 'AccessKeyId' => '', // sys_config('accessKey')
  82. 'AccessKeySecret' => '', // sys_config('secretKey')
  83. ],
  84. ]
  85. ];