Please enable JavaScript to view this site.

Process Designer

Navigation: PHP API > Work with attachments

Original file name (getOriginalFilename)

Scroll Prev Top Next More

This function allows you to determine the original file name of a file attached to an incident. In order to avoid complications with special characters or character formatting, all files are renamed when attached to an incident per default.

Parameter

Type


$fieldname

string

Name of process table or subtable column

$row

int

ID of a row within a subtable (optional)

$subtable

string

Subtable name (optional)

$includeFolder

bool

Flag in order to set if the name of the attachment directory should be returned (optional), default value is false.

This function returns the original file name of a file attached to an incident. In case of an error a JobRouterException is thrown.

Example:

// Original file names for the attachments in the field ATTACHMENT of the process table without

// the attachment directory

$originalFilename = $this->getOriginalFilename('ATTACHMENT');

 

// Original file names for the attachments in the field ATTACHMENT of the process table
// including the attachment directory 

$originalFilepath = $this->getOriginalFilename('ATTACHMENT', 0, '', true);