|
@@ 454-461 (lines=8) @@
|
| 451 |
|
* @param string $uploadField |
| 452 |
|
* @return string |
| 453 |
|
*/ |
| 454 |
|
public function getUploadFileUrl(string $uploadField) : string |
| 455 |
|
{ |
| 456 |
|
$Url = $this->getUploadFileFullPath($uploadField); |
| 457 |
|
|
| 458 |
|
$uploadFieldPath = DirHelper::canonicalize($this->removePublicPath($Url)); |
| 459 |
|
|
| 460 |
|
return $uploadFieldPath == '' ? '' : URL::to($uploadFieldPath); |
| 461 |
|
} |
| 462 |
|
|
| 463 |
|
/** |
| 464 |
|
* get a path and remove public_path. |
|
@@ 488-499 (lines=12) @@
|
| 485 |
|
* @param string $uploadField |
| 486 |
|
* @return string |
| 487 |
|
*/ |
| 488 |
|
public function getUploadFileBaseUrl(string $uploadField) : string |
| 489 |
|
{ |
| 490 |
|
$uploadFieldPath = $this->getUploadFileBasePath($uploadField); |
| 491 |
|
|
| 492 |
|
$uploadFieldPath = DirHelper::canonicalize(DirHelper::addFinalSlash($this->removePublicPath($uploadFieldPath))); |
| 493 |
|
|
| 494 |
|
if ($this->isSlashOrEmptyDir($uploadFieldPath)) { |
| 495 |
|
return ''; |
| 496 |
|
} |
| 497 |
|
|
| 498 |
|
return URL::to($uploadFieldPath); |
| 499 |
|
} |
| 500 |
|
|
| 501 |
|
/** |
| 502 |
|
* Calcolate the new name for ALL uploaded files and set relative upload attributes |