<?php
ob_start();
include("CheckSession.php");
?>
<?php
  require_once("class/FileConfig.php");
  require_once("class/FileOperation.php");
  
  
  $fileName = $_GET["fileName"];
  $fileName = str_replace(';','/',$fileName);
  $downloadUrl = $fileName;
  $indexInt = strrpos($downloadUrl,'/');
  $fileName = substr($downloadUrl,$indexInt+1);
  header("Content-type: text/html; charset=utf-8");
  header('Content-type:application/force-download');
  header('Content-Transfer-Encoding: binary');
  header('Expires: 0');
  header('Cache-Control: must-revalidate');
  header('Pragma: public');
  header("Content-Length: " .(string)(filesize($downloadUrl)) );
  header("Content-Disposition: attachment; filename=".iconv("utf-8", "big5", $fileName));
  ob_clean();
  flush();
  readfile(iconv("utf-8", "big5", $downloadUrl));

?>