jamieynonan/file-management 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jamieynonan/file-management

Composer 安装命令:

composer require jamieynonan/file-management

包简介

this class can import files from a url or move, copy and rename an existing file on the server

README 文档

README

This library can import files from a url or move, copy and rename an existing file on the server.
Esta libreria puede importar archivos desde una url o mover, copiar y renombrar un archivo existente en el servidor.
Questa libreria può imporatare file da una url oppure spostare, copiare e rinominare un file esistente nel server.

example

use FileManagement\File;


$imgLocal = new File(__DIR__ .'/file.jpg'); //file
$imgUrl = new File('http://site.com/files/image.png'); //link

validate mime (optional - recommend)

//return bool
$imgLocal->validateMime('image/jpeg');
$imgUrl->validateMime('image/png');

save file

first set the path to save the file
$imgLocal->setPath(__DIR__ . '/files');
$imgUrl->setPath('/path/local/where/save/file');

$imgLocal->save();
$imgUrl->save('new-name'); //save and change name

copy, move, rename (Only allowed for internal files -on the server-)

//return new instance of File
$newImage = $imgLocal->copy('/same/path', 'new-name'); //copy with another name
$newImage2 = $newImage->copy('/new/path2'); //copy in another folder with the same name

$newImage2->move('/other/path'); //return bool

$newImage2->rename('new-name-file'); //return bool

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GLP-2.0
  • 更新时间: 2016-06-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固