Once you upload the file, don't forget to look into the "tmp" folder inside the "examples" folder for the result.
add('label', 'label_file', 'file', 'Upload Microsoft Word document'); // add the "file" element $obj = $form->add('file', 'file'); // set rules $obj->set_rule(array( // error messages will be sent to a variable called "error", usable in custom templates 'required' => array('error', 'A Microsoft Word document is required!'), 'upload' => array('tmp', ZEBRA_FORM_UPLOAD_RANDOM_NAMES, 'error', 'Could not upload file!');
print_r($form->file_upload);
die();
}
// auto generate output, labels above form elements
$form->render();
?>