承接 sevens/uploader-trait 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sevens/uploader-trait

Composer 安装命令:

composer require sevens/uploader-trait

包简介

A library for file upload in PHP.

README 文档

README

- It is part of the libraries used on the altvel framework project but can be used 
in any applicable file upload scenario.

- File Uploader a.k.a uploader-trait is developed by Elisha Temiloluwa a.k.a TemmyScope.

- Developed to make easier the routine of file upload on traditional file servers.


- Install using composer
composer require sevens/uploader-trait

Usage: Implementating & Extending

There are two ways to use this library in your project

- One way would be to call the Uploader constructor
use Seven\File\Uploader;

$uploader = new Uploader(
 string $destination = __DIR__.'/cdn', 
 array $allowedTypes = [ 'jpg' => 'image/jpeg', 'png' => 'image/png' ],
 int $sizeLimit =  5024768
);

$uploader->upload('image');
- Another way would be to extend the Uploader Class and provide the necessary properties

***If you don't provide the necessary properties, default values have already being provided in the Uploader Class ***

use Seven\File\Uploader;

class FileUploader extends Uploader{

 protected $destination = __DIR__.'/cdn';

 protected $allowedTypes = [ 'jpg' => 'image/jpeg', 'png' => 'image/png' ];

 protected $sizeLimit =  5024768;

}

Usage: Calling Methods

There are a couple useful methods to use in this library

	$file = new FileUploader();
- Upload $_FILES['image']
$file->upload('image'); 
- To get uploaded file name only
$file->name()
- To get uploaded file address, containing file address and name
$file->fullName(); 
- To get uploaded file type
$file->type();
- To get uploaded status; returns True if upload was successful
$file->status();
- To get error message; it would be empty if upload status is true
$file->statusMessage();

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固