Programmatically creating nodes with audiofield in Drupal 6

Go To StackoverFlow.com

1

How do I create audiofield (formfield as audio widget) content programmatically?

Specifically how I do "import" file contents (in this case MP3 files).

I tried node import module but does not seem to work properly.

This is Drupal 6 implementation.

Thanks,

Murali

2012-04-04 17:15
by Murali Srinivasan


0

I am not sure I fully understand your question. If you would like to upload an mp3 file to a cck node, you can use the filefield module.

  • create a new cck node-type
  • add a filefield to this nodetype, and select 'file' as the field type.
  • Configure this filefield: Under "Permitted upload file extensions", enter "mp3". Under "number of values", selected "unlimited" if you would like to upload an arbitrary number of mp3 files.

Once you define your node-type, you can programatically create a node with node_save(). See here: http://drupal.org/node/1111514

2012-05-06 00:26
by moondog
Ads