WC_Download_Handler::download_file_force PHP Method

download_file_force() public static method

Force download - this is the default method.
public static download_file_force ( string $file_path, string $filename )
$file_path string
$filename string
    public static function download_file_force($file_path, $filename)
    {
        $parsed_file_path = self::parse_file_path($file_path);
        self::download_headers($parsed_file_path['file_path'], $filename);
        if (!self::readfile_chunked($parsed_file_path['file_path'])) {
            if ($parsed_file_path['remote_file']) {
                self::download_file_redirect($file_path);
            } else {
                self::download_error(__('File not found', 'woocommerce'));
            }
        }
        exit;
    }