<?
include $_SERVER['DOCUMENT_ROOT'].'/common/lib/comm.php';
	$upload_path = $_SERVER['DOCUMENT_ROOT']."/uploadfile/se2/";	
	//$upload_path = $_SERVER['DOCUMENT_ROOT'].UPLOAD_PATH_CONSULTANT;
	$jsonArray = array();
	array_push($jsonArray,$_FILES[file]);
   	echo json_encode($jsonArray);	
	
	//$upload_file_report_name = upload($_FILES['file'],$upload_path, 50, array('gif',  'jpeg', 'jpg','png','bmp' ));
	//echo "joey>>".$upload_file_report_name;
	/*
	if (is_uploaded_file($_FILES['file']['tmp_name'])) { 
		if($_FILES['nm_file_report']['size'] > 0 ){
			$upload_file_report_name = upload($_FILES['nm_file_report'],$upload_path, 50, array('gif',  'jpeg', 'jpg','png','bmp' ));
			
			if($upload_file_report_name==false){
				AlertBack("첨부파일 업로드 실패 하였습니다."); 
				die();
			}
		}
	}*/
	
	$fileArr = array();
	for($i = 0; $i<count($_FILES["file"][size]);$i++){
		echo "joey!!!!!\n";	
		
		if($_FILES["file"][size][$i] >0){
			$fileObj = array();
			$fileObj["tmp_name"] = $_FILES["file"]["tmp_name"][$i];
			$fileObj["name"] = $_FILES["file"]["name"][$i];
			$fileObj["error"] = $_FILES["file"]["error"][$i];
			$fileObj["size"] = $_FILES["file"]["size"][$i];
			$fileObj["type"] =  $_FILES["file"]["type"][$i];
			$upload_file_report_name = upload($fileObj,$upload_path, 50, array('gif',  'jpeg', 'jpg','png','bmp' ));
		}
	}
	/*
	foreach ($_FILES["file"] as $key => $val) {
	        $tmp_name = $val["tmp_name"][$key];
	        $name = $val["name"][$key];
	       //echo  move_uploaded_file($tmp_name, $upload_path);
			//echo "$key";
			//echo "".$val[$key];
			
			//print_r($val);
			//echo $val[0];
			echo count($val);
			if (is_uploaded_file($tmp_name)) { 
				if( $val["size"][$key][''] > 0 ){
					$upload_file_report_name = upload($_FILES['file'],$upload_path, 50, array('gif',  'jpeg', 'jpg','png','bmp' ));
					//echo "joey>>".$upload_file_report_name;
				}
			}
					
	}
	 * */
	/*
	if (is_uploaded_file($_FILES['file']['tmp_name'])) { 
		if($_FILES['file']['size'] > 0 ){
			//$upload_file_report_name = upload($_FILES['file'],$upload_path, 50, array('gif',  'jpeg', 'jpg','png','bmp' ));
			//echo "joey>>".$upload_file_report_name;
		}
	}
		*/
	
?>
