Download the PHP package rmtop/rmsf-cloud-upload without Composer

On this page you can find all versions of the php package rmtop/rmsf-cloud-upload. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rmsf-cloud-upload

rmsf-cloud-upload

简述:


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

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

加密访问相关文件

安装插件

composer require rmtop/rmsf-cloud-upload

上传文件到本地

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

上传文件到腾讯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

$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实现


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实现

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);

All versions of rmsf-cloud-upload with dependencies

PHP Build Version
Package Version
Requires topthink/think-migration Version ^3.0
guzzlehttp/guzzle Version ~6.0
qcloud/cos-sdk-v5 Version >=2.0
ext-json Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rmtop/rmsf-cloud-upload contains the following files

Loading the files please wait ....