PHPackages                             rmtop/rmsf-cloud-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. rmtop/rmsf-cloud-upload

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

rmtop/rmsf-cloud-upload
=======================

upload

1.3.2(4y ago)049PHP

Since Jun 28Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jhz-code/rmsf-cloud-upload)[ Packagist](https://packagist.org/packages/rmtop/rmsf-cloud-upload)[ RSS](/packages/rmtop-rmsf-cloud-upload/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (3)Versions (32)Used By (0)

rmsf-cloud-upload
=================

[](#rmsf-cloud-upload)

#### 简述：

[](#简述)

```

包含：上传文件到本地、上传文件到腾讯cos、上传文件到阿里云oos

可上传超大文件、不受限制

加密访问相关文件

```

#### 安装插件

[](#安装插件)

```
composer require rmtop/rmsf-cloud-upload

```

#### 上传文件到本地

[](#上传文件到本地)

```
$result = TopUpload::TopSliceUpload();
var_dump($result);

```

#### 上传文件到腾讯cos

[](#上传文件到腾讯cos)

```
$result = TopUpload::TopSliceUploadToCos(string $COS_SECRETID,string $COS_SECRETKEY,string $COS_REGION,string $buckName,string $key);
var_dump($result);

```

#### 下载文件到内存输出下载

[](#下载文件到内存输出下载)

```
$result = TopUpload::TopDownFileForMemoryFromCos(string $COS_SECRETID,string $COS_SECRETKEY,string $COS_REGION,string $buckName,string $key);
var_dump($result);

```

#### 下载文件到服务器本地

[](#下载文件到服务器本地)

```
$result = TopUpload::TopDownFileForLocalFromCos(string $COS_SECRETID,string $COS_SECRETKEY,string $COS_REGION,string $buckName,string $key,string $localPath);
var_dump($result);

```

#### 获取文件URl

[](#获取文件url)

```
$result = TopUpload::TopGetFileUrlFromCos(string $COS_SECRETID,string $COS_SECRETKEY,string $COS_REGION,string $buckName,string $key,$time);
var_dump($result);

```

#### 删除文件

[](#删除文件)

```
$result = TopUpload::TopDeleteFileFromCos(string $COS_SECRETID,string $COS_SECRETKEY,string $COS_REGION,string $buckName,string $key);
var_dump($result);

```

### 增加图片库管理需求

[](#增加图片库管理需求)

```
配置开关 ： is_store

···································

为true时：
rm_static_upload 表记录相关上传文件数据

为false时：
只返回上传数据, 不记录数据表

·······································

rm_static_upload

记录所有上传图片的数据

便于通过该表管理所有上传的文件数据

```

#### 前端分片请求参数

[](#前端分片请求参数)

```

file: (binary)   //文件名称
blob_num: 1     //分块序号
total_blob_num: 284  //总共分块
file_name:   11.zip  //文件名

```

#### axios实现

[](#axios实现)

```

function upload (file, num) {
    file = "" //此处重点,获取选中的文件
    let formData = new FormData();
    let chunkTotal = Math.ceil(file.size / _this.chunkSize); // 总的chunk数
    let nextSize = Math.min((num + 1) * _this.chunkSize, file.size);
    let fileData = file.slice(num * _this.chunkSize, nextSize);
    formData.append("file", fileData);
    formData.append("name", time);
    formData.append("chunk", num);
    formData.append("chunks", chunkTotal);
    let config = {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    }
    axios.post('http://xxx.xxx.com/upload', formData, config).then(res => {
        if (res.data && res.data.code === 0) {
            if (num < chunkTotal - 1) {
                 upload(file, num + 1); //递归调用
            }
        } else {
            alert(res)
        }
    }, err => {
        alert('请求出错')
    })
}

upload(file, 0);//执行第一个文件块

```

#### jq实现

[](#jq实现)

```
function upload (file, num) {
    file = "" //此处重点,获取选中的文件
    let formData = new FormData();
    let chunkTotal = Math.ceil(file.size / _this.chunkSize); // 总的chunk数
    let nextSize = Math.min((num + 1) * _this.chunkSize, file.size);
    let fileData = file.slice(num * _this.chunkSize, nextSize);
    formData.append("file", fileData);
    formData.append("name", time);
    formData.append("chunk", num);
    formData.append("chunks", chunkTotal);
    $.ajax({
        url: "http://xxx.xxx.com/upload",
        type: "POST",
        data: formData,
        xhrFields: {
             withCredentials: true // 这里设置了withCredentials
        },
    processData: false,
    contentType: false,
    success: function (body) {
        if (body.code === 0) {
            if (num < chunkTotal - 1) {
                 upload(file, num + 1); //递归调用
            }
        } else {
            alert(body)
        }
    }
    });
}
upload(file, 0);

```

###  Health Score

27

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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 ~5 days

Recently: every ~11 days

Total

31

Last Release

1731d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75cda7b466041ada81703375143554be315e8d558c3d64bfd6878126de608518?d=identicon)[rmsf.top](/maintainers/rmsf.top)

---

Top Contributors

[![jhz-code](https://avatars.githubusercontent.com/u/64343721?v=4)](https://github.com/jhz-code "jhz-code (38 commits)")

### Embed Badge

![Health badge](/badges/rmtop-rmsf-cloud-upload/health.svg)

```
[![Health](https://phpackages.com/badges/rmtop-rmsf-cloud-upload/health.svg)](https://phpackages.com/packages/rmtop-rmsf-cloud-upload)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k54](/packages/neuron-core-neuron-ai)[google/cloud

Google Cloud Client Library

1.2k16.9M57](/packages/google-cloud)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)

PHPackages © 2026

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