if((bool)@ini_get("safe_mode") === FALSE && function_exists("shell_exec")){
$mime = @shell_exec($cmd);
if(strlen($mime) > 0){
$mime = explode("\n", trim($mime));
if(preg_match($regexp, $mime[(count($mime) - 1)], $matches)){
$this->file_type = $matches[1];
return;
}
}
}
if(function_exists("popen")){
$proc = @popen($cmd, "r");
if(is_resource($proc)){
$mime = @fread($proc, 512);
@pclose($proc);
if($mime !== FALSE){
$mime = explode("\n", trim($mime));
if(preg_match($regexp, $mime[(count($mime) - 1)], $matches)){
$this->file_type = $matches[1];
return;
}
}
}
}
//Fall back to the deprecated mime_content_type(), if available (still better than $_FILES[$field]["type"])
if(function_exists("mime_content_type")){
$this->file_type = @mime_content_type($tmp_name);
//It's possible that mime_content_type() returns FALSE or an empty string.
if(strlen($this->file_type) > 0){
return;
}
}
//If all else fails, use $_FILES default mime type.
$this->file_type = $type;
}
/**
* Set Multiple Upload Data
*
* @access protected
* @return void
*/
protected function set_multi_upload_data(){
$this->_multi_upload_data[] = array(
"file_name" => $this->file_name,
"file_type" => $this->file_type,
"file_path" => $this->upload_path,
"full_path" => $this->upload_path.$this->file_name,
"raw_name" => str_replace($this->file_ext, "", $this->file_name),
"orig_name" => $this->orig_name,
"client_name" => $this->client_name,
"file_ext" => $this->file_ext,
"file_size" => $this->file_size,
"is_image" => $this->is_image(),
"image_width" => $this->image_width,
"image_height" => $this->image_height,
"image_type" => $this->image_type,
"image_size_str" => $this->image_size_str
);
}
/**
* Get Multiple Upload Data
*
* @access public
* @return array
*/
public function get_multi_upload_data(){
return $this->_multi_upload_data;
}