Download the PHP package aileshe/upload without Composer

On this page you can find all versions of the php package aileshe/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 upload

Upload是什么?

一个PHP文件上传组件,该组件简化了上传文件的验证使用会更简单优雅!

安装

通过composer,这是推荐的方式,可以使用composer.json 声明依赖,或者直接运行下面的命令。

放入composer.json文件中

然后运行

基本用法

以下是一个模拟 "单文件上传" 和 "多文件上传" 的Demo表单HTML代码

upload.php 代码如下

上传成功返回打印结果

$upload->save($storage, $allow, $host)

- storage [string]

上传文件到哪的存储路径

- allow (optional) [array]

文件上传过滤允许规则定义

- host (optional) [string]

上传到服务器后文件的URL访问域名

$upload->save($storage, $host)

- storage [string]

上传文件到哪的存储路径

- host (optional) [string]

上传到服务器后文件的URL访问域名

返回值参照:

返回值 说明
Array() 上传文件成功
-1 上传失败
-2 指定上传文件的存储路径不合法
-3 上传非法格式文件
-4 文件大小不合符规定
-5 token验证错误

高级用法

1) 设置上传文件表单name, 默认是'file'

2) 开启 token验证

同时在上传文件时要也要POST提交正确的token

3) 上传指定格式文件(通过后缀名方式限制)

4) 上传指定格式文件(通过MIME方式限制)

5) 上传文件许可的大小限制

同时"过滤参数"是可以混用的, 如 只想限制文件大小和文件类型、可以上传xx后缀的同时要匹配MIME等.. 都可以的大胆相信无所不能!

6) 设置上传后返回文件URL的域名

设置域名img.sop6.com后返回的上传结果如下(带 * 号那行)

联系方式

Author: Dejan

QQ: 673008865


All versions of upload with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
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 aileshe/upload contains the following files

Loading the files please wait ....