To avoid problems with special characters or character coding, files are renamed by default, when they are appended to an instance. This function helps you to find the file name on file system level.
Parameter |
Type |
|
|---|---|---|
$filename |
string |
Name or path of the file |
The function delivers the file name, as it is saved in the file system.
Example:
…
// Original file name for attachment in field ANHANG of the process table
// with relative path
$originalFilename = $this->getOriginalFilename('ANHANG', 0, '', true);
// File name from file system
$filesystemFilename = $this->getFilesystemFilename($originalFilename);
// File name with absolute path
$fullFilePath = $this->getFullUploadPath($filesystemFilename);
// Copy file
copy($fullFilePath, 'C:\\myDocuments\\' . basename($filesystemFilename));
…