<?php
$valid_formats = array("jpg", "png", "gif", "bmp","jpeg","pdf","xls","xlsx");

$name_file 			= $_FILES['filegbr']['name'];
$size_file 			= $_FILES['filegbr']['size'];



$upload_status = 0;
if(strlen($name_file))
{
$file_ext = getExtension($name_file);

if(in_array(strtolower($file_ext),$valid_formats))
{
	
$path 				= "../../image/po_upload/";
$location 			= "image/po_upload/";
$actual_image_name 	= "";
$tmp 				= $_FILES['filegbr']['tmp_name'];
$kodefile 			= "po-".$i."-".$autoid."-".$autoid;

		$actual_image_name = $kodefile.".".$file_ext;
		

		if(move_uploaded_file($tmp, $path.$actual_image_name)){
				$fileloc = $location.$actual_image_name;
				$upload_status = 1;
				}
			else{
				echo "Gagal Upload";	
				return false;			
				}
}

else
echo "Invalid file format..";
}
?>