class OssDefaultUploadProvider extends OssDefaultUploadProvider

deprecated 3.1

Traits

AppTrait

Properties

protected Resp $error error from  AppTrait
protected Resp $success success from  AppTrait
static protected array deprecated $extensions 图片扩展的描述 from  DefaultUploadProvider
protected string $destination from  DefaultUploadProvider
protected string $disk from  DefaultUploadProvider
protected bool $watermark 是否启用水印 from  DefaultUploadProvider

Methods

getError()

获取错误

from  AppTrait
bool
setError(string|MessageBag $error)

设置错误

from  AppTrait
getSuccess()

Get success messages;

from  AppTrait
bool
setSuccess(Resp|string $success)

No description

from  AppTrait
__construct()

OssDefaultUploadProvider constructor.

mixed
setFolder($folder = 'uploads')

重新设置存储文件夹

mixed
setType(string $type)

设置类型

FilesystemAdapter
storage()

获取本地磁盘存储

setExtension(array $extension = [])

Set Extension

setResizeDistrict(int $resize)

District Size.

setQuality(int $quality)

设置图片压缩质量

setMimeType($mime_type)

设置图片mime类型

bool
saveFile(UploadedFile $file)

No description

StreamInterface
resize(mixed $content, int $width = 1920, int $height = 1440, bool $crop = false)

No description

bool
saveInput(mixed $content)

No description

string
getDestination()

获取目标路径

setDestination(string $destination)

No description

string
getUrl()

No description

string
getReturnUrl()

No description

setReturnUrl(string $url)

设置返回地址

static mixed
type(string $type, string $return_type = 'ext_string') deprecated

No description

bool
copyTo(string $dist)

No description

bool
delete()

No description

void
enableWatermark()

No description

Details

in AppTrait at line 30
Resp getError()

获取错误

Return Value

Resp

in AppTrait at line 43
bool setError(string|MessageBag $error)

设置错误

Parameters

string|MessageBag $error error

Return Value

bool

in AppTrait at line 72
Resp getSuccess()

Get success messages;

Return Value

Resp

in AppTrait at line 90
bool setSuccess(Resp|string $success)

No description

Parameters

Resp|string $success 设置的成功信息

Return Value

bool

__construct()

OssDefaultUploadProvider constructor.

Exceptions

LoadConfigurationException
OssException

mixed setFolder($folder = 'uploads')

重新设置存储文件夹

Parameters

$folder

Return Value

mixed

mixed setType(string $type)

设置类型

Parameters

string $type

Return Value

mixed

FilesystemAdapter storage()

获取本地磁盘存储

Return Value

FilesystemAdapter

setExtension(array $extension = [])

Set Extension

Parameters

array $extension 支持的扩展

setResizeDistrict(int $resize)

District Size.

Parameters

int $resize

设置resize 的区域

setQuality(int $quality)

设置图片压缩质量

Parameters

int $quality

setMimeType($mime_type)

设置图片mime类型

Parameters

$mime_type

bool saveFile(UploadedFile $file)

No description

Parameters

UploadedFile $file

file 对象

Return Value

bool

StreamInterface resize(mixed $content, int $width = 1920, int $height = 1440, bool $crop = false)

No description

Parameters

mixed $content 需要压缩的内容
int $width 宽度
int $height 高度
bool $crop 是否进行裁剪

Return Value

StreamInterface

bool saveInput(mixed $content)

No description

Parameters

mixed $content 内容流

Return Value

bool

string getDestination()

获取目标路径

Return Value

string

setDestination(string $destination)

No description

Parameters

string $destination 设置目标地址

string getUrl()

No description

Return Value

string

string getReturnUrl()

No description

Return Value

string

setReturnUrl(string $url)

设置返回地址

Parameters

string $url 地址

static mixed type(string $type, string $return_type = 'ext_string') deprecated

deprecated 3.1

No description

Parameters

string $type 类型
string $return_type 返回的类型

Return Value

mixed

bool copyTo(string $dist)

No description

Parameters

string $dist 目标路径

Return Value

bool

bool delete()

No description

Return Value

bool

void enableWatermark()

No description

Return Value

void