Files
webman-buildadmin/app/common/library/upload/Driver.php
2026-03-18 15:54:43 +08:00

36 lines
767 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace app\common\library\upload;
/**
* 上传驱动抽象类Webman 迁移版,支持 WebmanUploadedFile
*/
abstract class Driver
{
protected array $options = [];
/**
* 保存文件
* @param WebmanUploadedFile $file
* @param string $saveName
*/
abstract public function save(WebmanUploadedFile $file, string $saveName): bool;
/**
* 删除文件
*/
abstract public function delete(string $saveName): bool;
/**
* 获取资源 URL 地址
*/
abstract public function url(string $saveName, string|bool $domain = true, string $default = ''): string;
/**
* 文件是否存在
*/
abstract public function exists(string $saveName): bool;
}