class.upload.php 文件上传
最后更新于:2022-04-02 02:23:30
[TOC]
> [github](https://github.com/verot/class.upload.php)
## 安装
`composer requrie verot/class.upload.php`
## 文件上传
```
$handle = new upload($_FILES['image_field']);
if ($handle->uploaded) {
$handle->file_new_name_body = 'image_resized';
$handle->image_resize = true;
$handle->image_x = 100;
$handle->image_ratio_y = true;
$handle->process('/home/user/files/');
if ($handle->processed) {
echo 'image resized';
$handle->clean();
} else {
echo 'error : ' . $handle->error;
}
}
```
';