public function setAttachmentFileParams($fileName, $extension = null)
{
if ($extension === null)
{
$extension = pathinfo($fileName, PATHINFO_EXTENSION);
}
$extension = strtolower($extension);
if ($extension && isset($this->inlineDisplaySafeTypes[$extension]))
{
$this->contentType($this->inlineDisplaySafeTypes[$extension], '')
->setDownloadFileName($fileName, true);
}
else
{
$this->contentType('application/octet-stream', '')
->setDownloadFileName($fileName);
}
return $this;
}