Attach an image when node is created using AMFServer

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
martinbedouret's picture

Hi all,
I'm using drupal 7 and AMFServer (in services 3.0) to create node content from a Flash Client.
I'm able both to upload files and create nodes separately without problems, doing two different service calls (one to "file" service and another to the "node" service).
But I'm not being able to create a node with the a "File" field and attaching the file in the "node create" service call.
Is it possible to do that? I need to have the file "attached" to the node, instead of a node and a file in a separate way.
Thanks,
Martin

Comments

yes, you can!

trudog's picture
  • add a node with node/add/your_content_type;
  • print_r(node_load($created_node_nid);
  • send the fid to node.create in the same format as printed in step 2;