public static function SendDownloadHeader( string $file, int $filesize = null )
   {

      // Disable all caching mechanisms
      \header( 'Expires: 0' );
      \header( 'Cache-Control: private' );
      \header( 'Pragma: cache' );

      // The next header let the client download the file
      \header( 'Content-Disposition: attachment; filename="' . \rawurlencode( \basename( $file ) ) . '"' );

      // No we must send the associated content type
      static::SendContentType( MimeTypeTool::GetByFileName( $file ), null );

      // If no file size is defined but the file exists, getting the size.
      if ( empty( $filesize ) && \file_exists( $file ) )
      {
         $filesize = \filesize( $file );
      }

      // If a usable file size is known send the 'Content-Length' HTTP header
      if ( ! empty( $filesize ) )
      {
         \header( 'Content-Length: ' . $filesize );
      }

   }