tags:

views:

53

answers:

2

I'm beginning work on a project that will access a Drupal site to create nodes on the site. This includes file uploading, as the project is to allow people to upload pictures en mass to a Drupal site with minimal ado. Note that my application is written in .Net.

What I would like to know is the best approach to achieve the same? Based on initial research it looks like there are several options: 1. XML-RPC 2. Custom PHP module deployed in drupal. But, what is the way to invoke it from .Net? 3. Use a cron job to pick up the files from a watch folder. And add a cron_hook in my module to deploy the file.

A: 

Writing a XML-RPC server module in Drupal is real easy. It's about 5 lines of code in addition to the actual functionality (in short: implement hook_xmlrpc to tell the system the outside name by which your callback function is known), meaning it's actually simpler than a "normal" page callback, since implementing hook_menu can be fairly involved.

You can call them from .NET using any .NET XML-RPC package, like the one from http://www.xml-rpc.net/

The file-based approach can lead to "interesting" sequencing/exclusion/race conditions, which you'll save yourself when using the XML-RPC approach.

FGM
A: 

Check out the Services module and/or XML RPC in Drupal

http://drupal.org/project/Services

http://api.drupal.org/api/function/xmlrpc

Kevin