<?php

require_once '../SubFW/autoload.php';

$file = $_GET['id'];

$filepath = $tmpdir.'/'.$file;
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . $file . "\"");
readfile($filepath);

$extension = pathinfo($file, PATHINFO_EXTENSION);
if($extension == 'csv' || $extension == 'xlsm' || $extension=='zip' )
  unlink($filepath);

?>
