Display file size next to file link
Using HOOK_preprocess_field(&amp;$variables):

/**
 * Implements HOOK_preprocess_field().
 *
 * @inheritdoc
 */
function HOOK_preprocess_field(&amp;$variables) {
  $element = $variables['element'];
  // Check that field_name is set.
  if (isset($element['#field_name'])) {
    // Checking for field_name, but could check for field_type.
    if ($element['#field_name'] == 'field_name') {
      // Set our file size to a variable.
      $fileSize = $element[0]['#file']-&gt;filesize-&gt;value;
      // Edit our title for the field display.
      $element[0]['#file']-&gt;filename-&gt;value = $element[0]['#file']-&gt;filename-&gt;value . ' ' . $fileSize;
    }
  }
}




Using HOOK_preprocess_file_link(&amp;$variables):

/**
 * Add the "file-link.html.twig" template to your theme and adjust as needed.
 * 
 * Twig variables:
 * - {{ fileLinkDisplay.fileBundle }}
 * - {{ fileLinkDisplay.fileCreatedTime }}
 * - {{ fileLinkDisplay.fileChangedTime }}
 * - {{ fileLinkDisplay.fileFid }}
 * - {{ fileLinkDisplay.fileLangcode }}
 * - {{ fileLinkDisplay.fileMime }}
 * - {{ fileLinkDisplay.fileName }}
 * - {{ fileLinkDisplay.fileOwnerId }}
 * - {{ fileLinkDisplay.fileOwnerName }}
 * - {{ fileLinkDisplay.fileOwnerUserPictureUrl }}
 * - {{ fileLinkDisplay.fileSize }}
 * - {{ fileLinkDisplay.fileSizeFormatted }}
 * - {{ fileLinkDisplay.fileStatus }}
 * - {{ fileLinkDisplay.fileUrl }}
 * - {{ fileLinkDisplay.fileUuid }}
 */

function HOOK_preprocess_file_link(&amp;$variables) {
  if (isset($variables['file'])) {
    $variables['fileLinkDisplay'] = [
      'fileBundle' =&gt; $variables['file']
        -&gt;bundle(),
      'fileCreatedTime' =&gt; $variables['file']
        -&gt;getCreatedTime(),
      'fileChangedTime' =&gt; $variables['file']
        -&gt;getChangedTime(),
      'fileFid' =&gt; $variables['file']
        -&gt;fid-&gt;value,
      'fileLangcode' =&gt; $variables['file']
        -&gt;langcode-&gt;value,
      'fileMime' =&gt; $variables['file']
        -&gt;getMimeType(),
      'fileName' =&gt; $variables['file']
        -&gt;getFilename(),
      'fileOwnerId' =&gt; $variables['file']
        -&gt;getOwnerId(),
      'fileOwnerName' =&gt; $variables['file']
        -&gt;getOwner()-&gt;name-&gt;value,
      'fileOwnerUserPictureUrl' =&gt; file_create_url($variables['file']
        -&gt;getOwner()-&gt;user_picture-&gt;entity-&gt;uri-&gt;value),
      'fileSize' =&gt; $variables['file']
        -&gt;getSize(),
      'fileSizeFormatted' =&gt; format_size($variables['file']
        -&gt;getSize()),
      'fileStatus' =&gt; $variables['file']
        -&gt;status-&gt;value,
      'fileUrl' =&gt; file_create_url($variables['file']
        -&gt;getFileUri()),
      'fileUuid' =&gt; $variables['file']
        -&gt;uuid-&gt;value,
    ];
  }
}


See https://gitlab.com/prestosaurus/file-link-display/blob/master/file_link_display.module

Then your file-link.html.twig might look like:

{#
/**
 * @file
 * Theme override for a link to a file.
 *
 * @see template_preprocess_file_link()
 */
#}
{{ attach_library('classy/file') }}
&lt;span{{ attributes }}&gt;{{ icon }} {{ link }} {{ fileLinkDisplay.fileSize }} {{ fileLinkDisplay.fileMime }}&lt;/span&gt;