PHPackages                             jiker/file-store - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. jiker/file-store

ActiveLibrary[File &amp; Storage](/categories/file-storage)

jiker/file-store
================

文件文件上传及存储管理

1.0.10(5y ago)026[2 PRs](https://github.com/jiker-burce/file-store/pulls)MITPHP

Since Jul 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/jiker-burce/file-store)[ Packagist](https://packagist.org/packages/jiker/file-store)[ RSS](/packages/jiker-file-store/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (11)Used By (0)

文件通用包
-----

[](#文件通用包)

### 作用

[](#作用)

- 非jiker.com需要用到七牛上传时，每次需要加入多个模型和对上传数据的各种操作。
    - 文件上传
        - 获取config配置信息
            - 路由：/api/file/config
            - 参数： ```
                platform:project_default
                scene:project_public

                ```
            - 响应： ```
                {
                    "storage": "project-qiniu-public",
                    "driver": "qiniu",
                    "bucket": "project-public"
                }

                ```
        - 生成上传token
            - 路由：/api/file/qiniu-upload-token
            - 参数： ```
                bucket:project-public
                file_name:abc.jpg
                space:_for_xxx_sub_project
                folder:stacks

                ```
            - 响应： ```
                {
                    "bucket": "project-public",
                    "original_name": "abc.jpg",
                    "extension": "jpg",
                    "key": "_for_xxx_sub_project/2020/0703/stacks/ahJOVSLcf8H92dBCeoTltYWtqBCLfHvnTHSmRQys.jpg",
                    "token": "1sxqpZ0B-I4ZV1O07l4-JmnRduAF8XDK36l3HESX:Fo0GMB8Uc7dYXYxmBzzgJnVXfi4=:eyJyZXR1cm5Cb2R5Ijoie1wiYnVja2V0XCI6XCIkKGJ1Y2tldClcIixcImtleVwiOlwiJChrZXkpXCIsXCJldGFnXCI6XCIkKGV0YWcpXCIsXCJmbmFtZVwiOlwiJChmbmFtZSlcIixcImZzaXplXCI6XCIkKGZzaXplKVwiLFwibWltZVR5cGVcIjpcIiQobWltZVR5cGUpXCIsXCJlbmRVc2VyXCI6XCIkKGVuZFVzZXIpXCIsXCJwZXJzaXN0ZW50SWRcIjpcIiQocGVyc2lzdGVudElkKVwiLFwiZXh0XCI6XCIkKGV4dClcIixcInV1aWRcIjpcIiQodXVpZClcIn0iLCJzY29wZSI6InByb2RlZ3JlZS1wdWJsaWM6X2Zvcl9rY2VsbF9zdWJfcHJvamVjdFwvMjAyMFwvMDcwM1wvc3RhY2tzXC9haEpPVlNMY2Y4SDkyZEJDZW9UbHRZV3RxQkNMZkh2blRIU21SUXlzLmpwZyIsImRlYWRsaW5lIjoxNTkzODY2MTY5fQ==",
                    "url": {
                        "preview": "https://q2.cdn.project.com/_for_xxx_sub_project/2020/0703/stacks/ahJOVSLcf8H92dBCeoTltYWtqBCLfHvnTHSmRQys.jpg",
                        "download": "https://q2.cdn.project.com/_for_xxx_sub_project/2020/0703/stacks/ahJOVSLcf8H92dBCeoTltYWtqBCLfHvnTHSmRQys.jpg?attname=abc.jpg"
                    }
                }

                ```
        - 存储前端上传七牛后的UploadFile文件信息
            - 路由：/api/file/qiniu-file-store
            - 参数： ```
                // application/json

                {
                  "bucket": "project-public",
                  "name": "abc",
                  "space": "_for_xxx_sub_project",
                  "path": "_for_xxx_sub_project/2020/0704/stacks/a67Xh9nKQycU2mFBiRkSRu0nK201JjBSdH8qE7m8.jpg",
                  "title": "abc"
                }

                ```
            - 响应： ```
                {
                    "message": "上传成功",
                    "id": 3,
                    "name": "abc",
                    "extension": "",
                    "display_name": "abc",
                    "title": "abc",
                    "mime": null,
                    "size": null,
                    "path": "https://q2.cdn.project.com/_for_xxx_sub_project/2020/0704/stacks/a67Xh9nKQycU2mFBiRkSRu0nK201JjBSdH8qE7m8.jpg"
                }

                ```
    - 小程序二维码生成
        - 可以由后端或者前端指定参数就可以实现文件自动上传七牛，并且将UploadFile信息存放本地。
        - 调用方式
            - 调用类顶部
                - use FileStoreApi
            - FileStoreApi::generateMiniProgramQRCode()
                - 方法参数：
                    - $wxMiniAppId 小程序appid
                    - $bucket, 七牛空间
                    - $path, 路径
                    - $filename, 文件名
                    - $space 子项目空间，如：\_for\_xxx\_sub\_project

### 2种路由模式

[](#2种路由模式)

- 前端访问 token 校验方式「/api/file/」
    - 路由中间件中需要加上 'cors' =&gt; xxxx::class
    - AuthServiceProvider.php
        - 采用Jwt解析 Bearer token
    - config/auth.php
        - driver 需要调整为jwt
- 端对端 签名校验方式「/api/admin/pass-through/file/」
    - 路由中间件中需要加上 'auth:sign'

### 注意

[](#注意)

> 需要在开发项目中增加如下配置

- 在App\\Models中加入文件，命名空间为`App\Models`。均可从本插件包中拷贝
    - Storage.php
    - UploadFile.php

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

8

Last Release

2118d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f4bbf81ba64482e97809d3b4aaf93822e6a50331fbae7493341342552ec48d7?d=identicon)[brucegu](/maintainers/brucegu)

---

Top Contributors

[![storefee](https://avatars.githubusercontent.com/u/35602265?v=4)](https://github.com/storefee "storefee (10 commits)")

### Embed Badge

![Health badge](/badges/jiker-file-store/health.svg)

```
[![Health](https://phpackages.com/badges/jiker-file-store/health.svg)](https://phpackages.com/packages/jiker-file-store)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
