wutongshenyuan/php-file-uploader

tp5抽取的上传类,供学习用

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/wutongshenyuan/php-file-uploader

1.0 2019-11-01 01:44 UTC

This package is auto-updated.

Last update: 2025-09-12 19:09:09 UTC


README

这是从tp5中抽取出来的上传类 使用方法:

// 获取文件
$files = FileReceiver::getInstance()->file();
// 移动文件,默认使用move_uploaded_file移动文件,如果要使用自定义的移动类,请在移动前设置
// File::setFileMoveHandler(类名);
// 该handler可能需要一些配置 具体配置得看具体handler要求
// AzureMoveHandler::setConfig([]);
$desPath = 'uploads/';
foreach($files as $one){
    // 此路径是可以存入数据库的路径
    $filePath = $one->move($desPath);
}

php-file-uploader

php uploader