0
$language = field_language('node', $node, 'YOUR _FIELD_NAME'); 
foreach($node->YOUR_FIELD_NAME[$language] as $file) {
  echo drupal_realpath(file_load($file['fid'])->uri);
}

I used this code to send mail in attachments but image file does not work enter image description here

closed as unclear what you're asking by leymannx, Pierre.Vriens, kiamlaluno Jan 22 at 8:08

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

-2
<?php
foreach($node->field_name['und'] as $file) {
  echo  drupal_realpath(file_load($file['fid'])->uri);
echo ("\n");}
?>

This code worked for me!!!

Not the answer you're looking for? Browse other questions tagged or ask your own question.