Location: PHPKode > projects > ERPSOD > erpsod/file_download.php
<?php
include_once("config.php");
$ok=role_check();
if (!$ok){
	header("Location: login.php"); 
}
$file=$_GET["file"];
$linkfile = _DIR_HOME . _DIR_DOC . $file;
# Make sure that IE can download the attachments under https.
header( 'Pragma: public' );
header( 'Content-Type: text/richtext'  );
header( 'Content-Disposition: attachment; filename="' .  $file . '"' );
header( 'Content-Description: Download Data' );
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s \G\M\T', time() ) );
# dump file content to the connection.
if ( file_exists( $linkfile ) ) {
	readfile( $linkfile );
}
Return current item: ERPSOD