Download the PHP package peinhu/aetherupload-webman without Composer

On this page you can find all versions of the php package peinhu/aetherupload-webman. 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 aetherupload-webman

AetherUpload-Webman

本项目移植自广受好评的Laravel大文件上传扩展包:AetherUpload-Laravel

示例页面

功能特性

①:同步上传相比异步上传,在上传带宽足够大的情况下速度稍慢,但同步可在上传同时进行文件的拼合,而异步因文件块上传完成的先后顺序不确定,需要在所有文件块都完成时才能拼合,将会导致异步上传在接近完成时需等待较长时间。同步上传每次只有一个文件块在上传,在单位时间内占用服务器的内存较少,相比异步方式可支持更多人同时上传。

②:断线续传和断点续传不同,断线续传是指遇到断网或无线网络不稳定时,在不关闭页面的情况下,上传组件会定时自动重试,一旦网络恢复,文件会从未上传成功的那个文件块开始继续上传。断线续传在刷新页面或关闭后重开是无法续传的,之前上传的部分已成为无效文件。

③:文件秒传需服务端Redis和客户端浏览器支持(FileReader、File.slice()),两者缺一则秒传功能无法生效。默认关闭,需在配置文件中开启。

④:结合自定义中间件,可对已上传资源的访问、下载行为进行权限控制。

安装

0 在终端内切换到你的webman项目根目录,执行composer require peinhu/aetherupload-webman ^1.0

1 在浏览器访问http://域名/aetherupload可到达示例页面

提示:更改相关配置选项请编辑config/plugin/peinhu/aetherupload-webman/app.php

使用

文件上传

参考示例文件及注释,在需要上传大文件的页面引入相应文件及代码。

分组配置

在本插件配置文件的groups下新增分组,运行php webman aetherupload:groups自动创建对应目录。

在前端通过调用setGroup('分组名')方法指定上传分组,注意分组名必须已经存在。

添加秒传功能(需Redis及浏览器支持)

参考Webman文档Redis部分,安装所需依赖。
安装Redis并启动服务。
安装predis包composer require predis/predis
config/redis.php中设置clientpredis
在本插件配置文件中将instant_completion设置为true

提示:在Redis中维护了一份与实际资源文件对应的秒传清单,实际资源文件的增删造成的变化均需要同步到秒传清单中,否则会产生脏数据。
扩展包已包含新增部分,当需要删除资源文件时,使用者需手动调用对应方法删除文件及秒传清单中的记录。

自定义中间件

参考Webman文档路由中间件部分,创建你的中间件并将你编写的中间件名称填入配置文件对应部分。

可使用此功能对文件进行上传、访问、下载行为的权限控制。

自定义路由

在本插件配置文件下编辑'route_uploading' => '/aetherupload/uploading'等选项,在前端调用setUploadingRoute('/aetherupload/uploading')等方法。
文件访问、下载路由编辑后,可直接访问,无需调用前端方法。

上传完成事件

分为上传完成前、上传完成后事件,参考Webman文档常用组件Event事件部分。
config/event.php中为aetherupload.before_upload_completeaetherupload.upload_complete配置对应的事件处理类。
在本插件配置文件中将groups下相应选项设置为true

可使用此功能在上传完成前、上传完成后进行额外处理。

宽松模式

在本插件配置文件下编辑'lax_mode' => true,,在前端调用setLaxMode(true)方法。
通过上传前跳过计算hash,可缩短总耗时。此选项开启后,无法进行秒传和完整性校验。

多语言

前端检测浏览器语言后自动设置,目前支持中、英。

使用方便的控制台命令

php webman aetherupload:groups 列出所有分组并自动创建对应目录
php webman aetherupload:build 在Redis中重建资源文件的秒传清单
php webman aetherupload:clean 2 清除2天前的无效临时文件

优化建议

兼容性

IE Edge Firefox Chrome Safari
上传 10+ 12+ 3.6+ 6+ 5.1+
秒传 10+ 12+ 3.6+ 6+ 6+

安全性

AetherUpload在上传前使用白名单+黑名单的形式进行文件后缀名过滤,上传后再检查文件的Mime-Type类型。白名单直接限制了保存文件扩展名,黑名单默认屏蔽了常见的可执行文件扩展名,来阻止上传恶意文件,安全起见白名单一栏不应留空。

虽然做了诸多安全工作,但恶意文件上传是防不胜防的,建议正确设置上传目录权限,确保相关程序对资源文件没有执行权限。

更新日志

详见CHANGELOG.md

许可证

使用GPLv2许可证, 查看LICENCE文件以获得更多信息。


All versions of aetherupload-webman with dependencies

PHP Build Version
Package Version
Requires webman/event Version ^1.0
symfony/translation Version ^5.4
webman/console Version ^1.0
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 peinhu/aetherupload-webman contains the following files

Loading the files please wait ....