Skip to content

Instantly share code, notes, and snippets.

@jeremyboggs
Created December 22, 2011 20:08
Show Gist options
  • Save jeremyboggs/1511651 to your computer and use it in GitHub Desktop.
Save jeremyboggs/1511651 to your computer and use it in GitHub Desktop.
Inserting multiple files for an item.
<?php
$files = array(
'http://example.com/file1.txt' => array(
'Dublin Core' => array(
'Title' => array('text' => 'Title of my first item'),
'Description' => array('text' => 'Description of my first item.')
)
),
'http://example.com/file2.txt' => array(
'Dublin Core' => array(
'Title' => array('text' => 'Title of my second item'),
'Description' => array('text' => 'Description of my second item.')
)
),
);
foreach ($files as $url => $metadata) {
insert_files_for_item($item, 'URL', array('source' => $url, 'name' => null, 'metadata' => $metadata);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment