Hi all. I need to import (from an OLD proprietary CMS) more and more notes that have a file field.
I have created my node type with a file CCK field, but I can not found how to create an entry for the file that was uploaded (like /tutorial/tutorialpsp3.zip).
I use this method where $l contains the info of my OLD node:
.... $node = array(); $node['type'] = "manuali_file"; /* NOT WORKS $l1 = split("/",$l[11]); $i2 = count($l1); $node['field_allegati_manuale_upload'] = array(0 => array( 'description' => $l1[($i2-1)], 'filename' => $l1[($i2-1)], 'filepath' => $l[11], 'filesize' => $l[10] ) ); */ //$node['field_allegati_manuale'] = $l[11];
$node['status'] = 0; $node['comment']=2; $node['promote'] = 0; $node['sticky'] = 0; $node['title']=$l[2]; $node['body']=$l[2]; $node['uid'] = 0; $node['status'] = 1; $d = split("/",$l[12]); $node['created']=mktime(0,0,0,$d[1],$d[0],$d[2]); $node['changed']=$node['created'];
//Tiro fuori la id_categoria nuova $result = db_query("select tid from michel_import_old where id = ".$l[7]); $t = db_fetch_object($result); $node['taxonomy'] = array($t->tid); $node = node_submit($node); node_save($node);
It works for normal node, But not for this one.
Tnx.