Change record status: 
Project: 
Introduced in branch: 
9.x
Description: 

URL options can now be passed on to the file link template. These options are applied to the link itself.

For example, to open a link in a new window the following could be used in template_preprocess_file_link():

$variables['link_options']['attributes']['target'] = '_blank';

See Url::fromUri for a list of valid URL options.

Impacts: 
Module developers
Themers