/**
* Method to find out the correct transfer mode for a specific file
*
* @param string $fileName Name of the file
*
* @return integer Transfer-mode for this filetype [FTP_ASCII|FTP_BINARY]
*
* @since 1.5
*/
protected function _findMode($fileName)
{
if ($this->_type == FTP_AUTOASCII) {
$dot = strrpos($fileName, '.') + 1;
$ext = substr($fileName, $dot);
if (\in_array($ext, $this->_autoAscii)) {
$mode = FTP_ASCII;
} else {
$mode = FTP_BINARY;
}
} elseif ($this->_type == FTP_ASCII) {
$mode = FTP_ASCII;
} else {
$mode = FTP_BINARY;
}
return $mode;
}