wutongshenyuan/php-file-uploader

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

1.0 2019-11-01 01:44 UTC

This package is auto-updated.

Last update: 2024-10-12 17:04:49 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