Adding attributes to a link to an uploaded file
file-link.html.twig
&lt;span{{ attributes }}&gt;{{ link|merge({'#attributes': {'target': '_blank'}}) }}&lt;/span&gt;
{% if file_size %}
  {# @todo remove class before Drupal 9.0.0 #}
  &lt;span class=&quot;file-size&quot;&gt;({{ file_size }})&lt;/span&gt;
{% endif %}


Alternatively, you can also solve this via preprocess.
mytheme.theme
/**
 * Implements hook_preprocess_HOOK().
 */
function mytheme_preprocess_file_link(&amp;$variables) {
  $variables['link']['#url']-&gt;setOption('attributes', ['target' =&gt; '_blank']);
}