Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Revises headers

AuthorDaveJarvis <email>
Date2023-11-10 19:27:11 GMT-0800
Commit033025e13cdd62654547b79d4a52e0d448523b8e
Parentbc3975f
Delta8 lines added, 7 lines removed, 1-line increase
www/downloads/counter.php
}
- header("Content-Type: application/octet-stream");
- //header( "Content-Type: $content_type" );
- header( 'Pragma: public' );
+ $quoted = sprintf( '"%s"', addcslashes( basename( $filename ), '"\\' ) );
+
+ header( 'Content-Description: File Transfer' );
+ header( 'Content-Type: application/octet-stream' );
+ header( 'Content-Disposition: attachment; filename=' . $quoted );
+ header( 'Content-Transfer-Encoding: binary' );
+ header( 'Connection: Keep-Alive' );
header( 'Expires: 0' );
header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
- header( 'Cache-Control: public' );
+ header( 'Pragma: public' );
header( 'Content-Length: ' . ($seek_end - $seek_start + 1) );
- header( 'Content-Transfer-Encoding: binary' );
- header( 'Content-Description: File Transfer' );
- header( "Content-Disposition: attachment; filename=\"$filename\"" );
// If the file doesn't exist, don't count it as a download.