|
|
|
@ -102,14 +102,16 @@ class Upload extends BaseService |
|
|
|
|
public function uploadByExternal(int $fileType, string $fileUrl): bool |
|
|
|
|
{ |
|
|
|
|
// 文件信息 |
|
|
|
|
$parseUrl = parse_url($fileUrl); |
|
|
|
|
//$parseUrl = parse_url($fileUrl); |
|
|
|
|
//var_dump($parseUrl); |
|
|
|
|
//exit(); |
|
|
|
|
$fileInfo = [ |
|
|
|
|
'storage' => 'external', |
|
|
|
|
'domain' => "{$parseUrl['scheme']}://{$parseUrl['host']}", |
|
|
|
|
'file_name' => basename($parseUrl['path']), |
|
|
|
|
'file_path' => ltrim($parseUrl['path'], '/'), |
|
|
|
|
'domain' => '',//"{$parseUrl['scheme']}://{$parseUrl['host']}", |
|
|
|
|
'file_name' => '',//basename($parseUrl['path']), |
|
|
|
|
'file_path' => $fileUrl, |
|
|
|
|
'file_size' => 0, |
|
|
|
|
'file_ext' => pathinfo($fileUrl)['extension'], |
|
|
|
|
'file_ext' => '',//pathinfo($fileUrl)['extension'], |
|
|
|
|
]; |
|
|
|
|
// 添加文件库记录 |
|
|
|
|
return $this->record($fileInfo, $fileType); |
|
|
|
|