D8 get file path of file field from a node

use DrupalnodeEntityNode;

$node = Node::load($nid);
$droot = Drupal::root();
$file_url = $node->YOUR FIELD NAME->entity->getFileUri();
$file_path = str_replace(“public://”, “”, $file_url);
$newfile_path = $droot . “/sites/default/files/” . $file_path;

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/2/feed