I’m currently working on a Flash application that needs to save files to Drupal. I already saved the file to the Drupal site with the File service, but I can’t get to attach the file to the node with the node.save service (Upload module, not CCK file field).
The object that I will transfer with node.save looks like this in AS3 :
var node:Object;
// all the other required node fields : nid, type, language, uid, name,
// status, title, changed, created, format, taxonomy, picture
node.files = new Array();
var aFile:Array = new Array;
aFile['list']=1;
aFile['weight']=0;
aFile['remove']=0;
aFile['description']="test.txt";
// id = id of the previously saved file
node.files[id] = aFile;
I guess there’s some fields missing or something like that.
I found it actually concerns only modules who modify data directly in the object loaded with node_load() before saving it with node_save(). Other modules (like CCK) act on the #post data of the form (with drupal_execute).
The service module needs a patch to be able to handle the upload module (or any module like this one).
You can follow the details on the ticket I have opened here http://drupal.org/node/881740