Tuesday, June 28, 2011

Drupal | programmatically create node with file field

$node = new StdClass();
        $node->type = 'bzl_img';
        $node->uid = $_GET['user_id'];
        $node->field_bzl_img_ref[0]['nid']=$_GET['bz_id'];
        $node->status = 0;
        $node->field_bzl_img_main[0]['value']=0;