<?php

if(isset($_POST['progress_key'])) {
	$status = apc_fetch('upload_'.$_POST['progress_key']);
	if(isset($status['current']) && isset($status['total'])){
		
		echo "{\"status\":\"SUKSES\",\"pesan\":\"".(($status['current']/$status['total'])*100)."\"}";
	}else{
		echo "{\"status\":\"SUKSES\",\"pesan\":\"0\"}";
	}
	
}else{
	echo "{\"status\":\"GAGAL\",\"pesan\":\"GAGAL\"}";
}
?>