Download the PHP package dungang/yii2-file-storage without Composer

On this page you can find all versions of the php package dungang/yii2-file-storage. 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 yii2-file-storage

file-storage

文件存储集合,本地存储,阿里云oss,七牛。

重构

阿里云和七牛在处理分片合并的时候是需要API的明确的告诉之前的分片信息的。 之前在处理阿里云和七牛的分片上传的时候,如果是文件不大,分片不多,可以正常。合并的参数是通过请求响应来合传递的。而且是强制约束按照时间顺序单线程执行,效率不高。

重构后,支持并发多线程请求上传分片数据。但是七牛还是单线程顺序执行(否则会导致合并参数丢失或覆盖)

安装

关于uploadId

使用方法

client                      server
-------                  --------------
   |                           |
   |        init upload        |
   |-------------------------->|
   |    uploadId,key           |
   |<--------------------------|
   |                           |
   |  uploadId key chunk-1     | 
   |-------------------------->|
   |       isCompleted=false   |
   |<--------------------------|
   |  uploadId key chunk-n     |
   |-------------------------->|
   |       isCompleted=true    |
   |<--------------------------|
   |                           |

1.配置控制器

  1. 获取文件上传的服务器参数
参数 required 说明
name 必须 原始文件名称,包括文件后缀
type 必须 文件类型,image/jpeg
timestamp 必须 时间戳,同一个页面可以使用同一个时间戳

前端以fex-webuploader 为例

后端

结果类似

3.处理上传的数据

参数 required 说明
uploadId 必须 每次发起上传文件前获取一个服务器全局唯一id,每个文件的uploadId是不同的
key 必须 是在服务器分配uploadId的时候同步返回的,是文件最终存储的路径
name 必须 原始文件名称,包括文件后缀
size 必须 原始文件的大小
type 必须 文件类型,image/jpeg
chunks 分片时必须 分片总数量
chunk 分片时必须 本次请求的分片的序号,从0开始

前端以fex-webuploader 为例

后端

结果,以实际获得的结果为准

阿里云

分片大小至少100kb,除最后一块

七牛

分片大小必须设置为4m 所以 至少是4m upload_max_filesize = 4M
post_max_size = 8M

注意事项

协议

MIT License

Copyright (c) 2017 dungang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of yii2-file-storage with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
aliyuncs/oss-sdk-php Version ~2.0
qiniu/php-sdk Version ~v7.1
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 dungang/yii2-file-storage contains the following files

Loading the files please wait ....