Hello, I don't know how to set the description when uploading multiple images through the api.
So far images get uploaded nicely.
// instantiate the class and give it the name of the HTML field
$u = new WireUpload('uploads');
// tell it to only accept 5 files
$u->setMaxFiles(5);
// tell it to rename rather than overwrite existing files
$u->setOverwrite(false);
// have it put the files in their final destination. this should be okay since
// the WireUpload class will only create PW compatible filenames
$u->setDestinationPath($page->images->path);
// tell it what extensions to expect
$u->setValidExtensions(array('jpg', 'jpeg', 'gif', 'png'));
// execute() returns an array, so we'll foreach() it.
foreach($u->execute() as $filename) {
$page->images->add($filename);
}
// save the page
$page->save();