private function setContentTypeByMimeType()
	{
		$mime    = null;
		$charset = '';

		if ($this->setMime === true)
		{
			if (($last_dot_position = strrpos($this->filename, '.')) !== false)
			{
				$mime    = Mimes::guessTypeFromExtension(substr($this->filename, $last_dot_position + 1));
				$charset = $this->charset;
			}
		}

		if (! is_string($mime))
		{
			// Set the default MIME type to send
			$mime    = 'application/octet-stream';
			$charset = '';
		}

		$this->setContentType($mime, $charset);
	}
private function setContentTypeByMimeType()
	{
		$mime    = null;
		$charset = '';

		if ($this->setMime === true)
		{
			if (($last_dot_position = strrpos($this->filename, '.')) !== false)
			{
				$mime    = Mimes::guessTypeFromExtension(substr($this->filename, $last_dot_position + 1));
				$charset = $this->charset;
			}
		}

		if (! is_string($mime))
		{
			// Set the default MIME type to send
			$mime    = 'application/octet-stream';
			$charset = '';
		}

		$this->setContentType($mime, $charset);
	}
private function setContentTypeByMimeType ( ) { $ mime = null ; $ charset = '' ; if ( $ this -> setMime === true ) { if ( ( $ last_dot_position = strrpos ( $ this -> filename , '.' ) ) !== false ) { $ mime = Mimes :: guessTypeFromExtension ( substr ( $ this -> filename , $ last_dot_position + 1 ) ) ; $ charset = $ this -> charset ; } } if ( ! is_string ( $ mime ) ) { // Set the default MIME type to send $ mime = 'application/octet-stream' ; $ charset = '' ; } $ this -> setContentType ( $ mime , $ charset ) ; }
Set content type by guessing mime type from file extension
Set content type by guessing mime type from file extension