lang/php

CI hwp 파일 업로드 (unknown file extension upload), 다운로드

C/H 2016. 7. 2. 01:57

unknown file extension upload

// CI2, CI3 : application/config/mimes.php Add MIME type
	'hwp'   => Array('application/unknown', 'text/plain')

// CI 2.2.6 : system/libraries/Upload.php Modify
	public function mimes_types($mime)
	{
		global $mimes;

		if (count($this->mimes) == 0)
		{
			if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
			{
				// include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
				$mimes = include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
			}
			elseif (is_file(APPPATH.'config/mimes.php'))
			{
				// include(APPPATH.'config/mimes.php');
				$mimes = include(APPPATH.'config/mimes.php');
			}
			else
			{
				return FALSE;
			}

			$this->mimes = $mimes;
			unset($mimes);
		}

		return ( ! isset($this->mimes[$mime])) ? FALSE : $this->mimes[$mime];
	}


반응형

'lang > php' 카테고리의 다른 글

Centos7 Nginx+php7+php-fpm  (0) 2017.02.21
php7.1 mcrypt_get_iv_size Error  (0) 2017.02.17
PHP RedisClient Class  (0) 2016.06.07
PHP Redis  (0) 2016.06.03
composer codeigniter  (0) 2016.04.12