DefaultFileProvider
class DefaultFileProvider implements FileContract
图片上传类
Traits
AppTrait
Properties
protected Resp | $error | error | from AppTrait |
protected Resp | $success | success | from AppTrait |
protected string | $destination | ||
protected string | $disk | ||
protected bool | $watermark | 是否启用水印 | |
protected int|null | $resizeLongDistrict | 长边限制 |
Methods
__construct()
上传文件夹地址
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)
设置返回地址
setIsForceSetDestination(bool $isForceSetDestination)
No description
bool
copyTo(string $dist)
No description
bool
delete()
No description
void
enableWatermark()
No description
Details
in
AppTrait at line 45
bool
setError(string|MessageBag $error)
设置错误
at line 91
__construct()
上传文件夹地址
at line 98
mixed
setFolder($folder = 'uploads')
重新设置存储文件夹
at line 108
mixed
setType(string $type)
设置类型
at line 120
FilesystemAdapter
storage()
获取本地磁盘存储
at line 133
setExtension(array $extension = [])
Set Extension
at line 143
setResizeDistrict(int $resize)
District Size.
at line 154
setQuality(int $quality)
设置图片压缩质量
at line 165
setMimeType($mime_type)
设置图片mime类型
at line 175
bool
saveFile(UploadedFile $file)
No description
at line 227
StreamInterface
resize(mixed $content, int $width = 1920, int $height = 1440, bool $crop = false)
No description
at line 268
bool
saveInput(mixed $content)
No description
at line 305
string
getDestination()
获取目标路径
at line 313
setDestination(string $destination)
No description
at line 322
string
getUrl()
No description
at line 331
string
getReturnUrl()
No description
at line 340
setReturnUrl(string $url)
设置返回地址
at line 353
setIsForceSetDestination(bool $isForceSetDestination)
No description
at line 362
bool
copyTo(string $dist)
No description
at line 374
bool
delete()
No description
at line 385
void
enableWatermark()
No description