Question

$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

Was it helpful?

Solution

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

This code worked for me!!!

Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top