| @@ 434-447 (lines=14) @@ | ||
| 431 | * @param string $uploadField |
|
| 432 | * @return string |
|
| 433 | */ |
|
| 434 | public |
|
| 435 | function getUploadFileFullPath( |
|
| 436 | string $uploadField |
|
| 437 | ) : string |
|
| 438 | { |
|
| 439 | $uploadFieldPath = $this->getUploadFileBasePath($uploadField); |
|
| 440 | $uploadFieldPath = DirHelper::canonicalize(DirHelper::addFinalSlash($uploadFieldPath) . $this->{$uploadField}); |
|
| 441 | ||
| 442 | if ($this->isSlashOrEmptyDir($uploadFieldPath)) { |
|
| 443 | return ''; |
|
| 444 | } |
|
| 445 | ||
| 446 | return $uploadFieldPath; |
|
| 447 | } |
|
| 448 | ||
| 449 | /** |
|
| 450 | * Return the full url (base url + filename) for the passed attribute. |
|
| @@ 456-463 (lines=8) @@ | ||
| 453 | * @param string $uploadField |
|
| 454 | * @return string |
|
| 455 | */ |
|
| 456 | public |
|
| 457 | function getUploadFileUrl( |
|
| 458 | string $uploadField |
|
| 459 | ) : string |
|
| 460 | { |
|
| 461 | $Url = $this->getUploadFileFullPath($uploadField); |
|
| 462 | ||
| 463 | $uploadFieldPath = DirHelper::canonicalize($this->removePublicPath($Url)); |
|
| 464 | ||
| 465 | return $uploadFieldPath == '' ? '' : URL::to($uploadFieldPath); |
|
| 466 | } |
|
| @@ 496-507 (lines=12) @@ | ||
| 493 | * @param string $uploadField |
|
| 494 | * @return string |
|
| 495 | */ |
|
| 496 | public |
|
| 497 | function getUploadFileBaseUrl( |
|
| 498 | string $uploadField |
|
| 499 | ) : string |
|
| 500 | { |
|
| 501 | $uploadFieldPath = $this->getUploadFileBasePath($uploadField); |
|
| 502 | ||
| 503 | $uploadFieldPath = DirHelper::canonicalize(DirHelper::addFinalSlash($this->removePublicPath($uploadFieldPath))); |
|
| 504 | ||
| 505 | if ($this->isSlashOrEmptyDir($uploadFieldPath)) { |
|
| 506 | return ''; |
|
| 507 | } |
|
| 508 | ||
| 509 | return URL::to($uploadFieldPath); |
|
| 510 | } |
|