<?php
/**
* @package ViewGetFile
* @copyright Copyright (c) PT Gamatechno Indonesia
* @Analyzed By Dyan Galih
* @author Didi Z
* @version 01
* @startDate 2013-01-01
* @lastUpdate 2013-01-01
* @description Class ViewGetFile
*/

require_once Configuration::Instance()->GetValue('application', 'docroot') . "main/lib/streamFile/streamFile.class.php";

class ViewGetFile extends HtmlResponse {

	function TemplateModule() {
	}

	function ProcessRequest() {
	  $path = Configuration::Instance()->GetValue( 'application','docroot').'file/';

      $_GET = $_GET->AsArray();

      $file = urldecode($_GET['file']);
      $realPath = $path.$file;
      $data = StreamFile::stream($realPath,$file);

      if($data){
         echo $data;
         exit;
      }else
         echo "<script>alert('Data Tidak Ditemukan')</script>";
		 echo $realPath;
		 echo file_exists($realPath);
      exit;
	}

	function ParseTemplate($data = NULL) {
	}
}
?>
