How do I get file ID from node? How can I get file ID like I got, for instance, file URI:

$getFile = $entity-&gt;get('field_file')-&gt;entity-&gt;getFileUri();


I need it to send an email (swiftmailer)

$file_one = file_load(1);
The file ID is the property target_id of the file field:

$fid = $entity-&gt;get('field_file')-&gt;target_id;