PHPackages                             janfish/file-slice-upload - 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. janfish/file-slice-upload

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

janfish/file-slice-upload
=========================

janfish file slice upload

02PHP

Since May 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/zeng444/file-slice-upload)[ Packagist](https://packagist.org/packages/janfish/file-slice-upload)[ RSS](/packages/janfish-file-slice-upload/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

#### 文件分片上传

[](#文件分片上传)

> 文件分片，实现超大文件的在线上传

```
$chunkQuantity = $_POST['chunkQuantity'];
$currentChunkNo = $_POST['chunkNo'];
$fileName = $_FILES['file']['name'];
$tempPath = $_FILES['file']['tmp_name'];
$all = pathinfo($fileName);
$extension = $all['extension'];
$name = $all['filename'];
$dist = 'files/' . $name . '.' . $extension;

$file = new Janfish\Upload\File($chunkQuantity);
$file->setSessionKey($fileName);
if (!$file->append($currentChunkNo, $tempPath, $dist)) {
    die(json_encode([
        'status'=>'success',
        'data' => [
            'path' => $dist,
            'url' => '',
            'isFinished' => false,
        ],
    ]))
}
die(json_encode([
    'status'=>'success',
    'data' => [
        'path' => $dist,
        'url' => '',
        'isFinished' =>  $file->isFinished(),
    ],
]))

```

### html Vue组件

[](#html-vue组件)

> 基于elementUi

```

```

- 参数

项类型默认值说明btn-textstring上传文件上传按钮显示apistring-上传后端接口Urlshow-progressbooleantrue是否显示进度条chunk-sizenumber1单个分片大小，单位Macceptstring-允许的文件格式，默认为支持所有- 事件

项类型说明on-progressfunction(rate)上传进度on-errorfunction(msg)上传发生错误的回调事件on-successfunction(fileUrl, filePath)上传成功的回调事件

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/60a62fd9f299f25558ac4a898ae3833bd7185ba4706bb167a8cabf05a3d96955?d=identicon)[Robert Zeng](/maintainers/Robert%20Zeng)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/janfish-file-slice-upload/health.svg)

```
[![Health](https://phpackages.com/badges/janfish-file-slice-upload/health.svg)](https://phpackages.com/packages/janfish-file-slice-upload)
```

PHPackages © 2026

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