$content_disposition = isset($_GET['content_disposition']) ? $_GET['content_disposition'] : 'attachment';
// Проверка наличия файла.
if ( ! file_exists( $'xml_filename' ) ) {
exit( 0 );
}
// Время создания файла
$file_time = filemtime( $opt['xml_filename' );
if ('inline' === $content_disposition) {
header( "Content-Disposition: inline" );
header( "Content-type: text/xml; charset=utf-8", true, 200 );
} else {
header( "Content-type: application/xml", true, 200 );
header( "Content-Disposition: attachment; filename=myxml" . date( "_d-m-Y_H:i:s", $file_time ) . ".xml" );
}
header( "Pragma: no-cache" );
header( "Expires: 0" );
readfile( $xml_filename );
exit( 0 );