Get paths of files attached to the node from field name How can I get the paths (URLs) of files attached to the node from field name in Drupal 8?

I tried using Drupal 7's node_load(), but that does not return paths of the files:

$node = \Drupal::routeMatch()-&gt;getParameter('node');
$node = node_load($node-&gt;id());
var_dump($node);
You can get it like this:

$file_uri = $node-&gt;field_machine_name-&gt;entity-&gt;getFileUri(); 

If your field allows for more than 1 value, then:

$file_uris = array();
foreach ($node-&gt;field_machine_name as $value) {
  if ($value-&gt;entity) {
    $file_uris[] = $value-&gt;entity-&gt;getFileUri();
  }
}