drupaldrupal-8drupal-hooks

drupal 8 file upload path on node_presave hook


I need to find the file uploaded path on node_presave hook

   function hooks_example_node_presave(EntityInterface $node) {

var_dump($node->field_image_upload->getValue()); exit;

    }

This is what I tried. Help would be appreciated. Thanks Raj


Solution

  • I found solutions. Following will get the uploaded file url.

    $node->field_image_upload->entity->url()