Fix for Image Field Import

  1. $scan = file_scan_directory($full, 'jpg|png|gif|JPG|PNG');
  2.  
  3. foreach($scan AS $path => $image) {
  4.  
  5.       $temp_image = field_file_save_file($path, $validators, $directory);
  6.       $temp_image['status'] = FILE_STATUS_PERMANENT;
  7.       $temp_image['list'] = 1;
  8.       $temp_image['uid'] = $uid;
  9.       $temp_image['data'] = array ('description' => $data[1], 'alt' => $data[1], 'title' => $data[1]);
  10.       $node->field_bilder[$i++] = $temp_image;
  11.       $temp_image['original_path'] = $path;
  12.       //echo $bilder;
  13. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.