$importImage = true;
//Sanitation
if (!$uspid || !preg_match('/^[0-9,]+$/', $uspid)) {
    exit('ERROR: illegal upload profile identifier ');
}
$duManager = new SpecUploadDwca();
$duManager->setVerboseMode(2, 'batchDwcaUpload');
$duManager->setIncludeIdentificationHistory($importIdent);
$duManager->setIncludeImages($importImage);
$uspidArr = explode(',', $uspid);
foreach ($uspidArr as $uploadId) {
    //Initiate parameters
    $duManager->setUspid($uploadId);
    $duManager->readUploadParameters();
    $duManager->setSourceDatabaseType('batchDwcaUpload');
    if ($duManager->getTitle() == '') {
        exit('ERROR: unable to set upload profile data (uspid: ' . $uploadId . ')');
    }
    if ($duManager->getCollInfo('managementtype') != 'Snapshot') {
        exit('ERROR: automatic updates only allowed for Snapshot collections');
    }
    $duManager->loadFieldMap(true);
    $ulPath = $duManager->uploadFile();
    if (!$ulPath) {
        exit('ERROR uploading file: ' . $duManager->getErrorStr());
    }
    if (!$duManager->analyzeUpload()) {
        exit('ERROR analyzing upload file: ' . $duManager->getErrorStr());
    }
    if (!$duManager->uploadData(false)) {
        exit('ERROR uploading file: ' . $duManager->getErrorStr());
示例#2
0
						</div>
					</fieldset>
				</form>
				<?php 
        } else {
            //Upload type is direct, file, or DWCA
            if (!$ulPath && ($uploadType == $FILEUPLOAD || $uploadType == $SKELETAL || $uploadType == $DWCAUPLOAD)) {
                //Need to upload data for file and DWCA uploads
                $ulPath = $duManager->uploadFile();
                if (!$ulPath) {
                    //Still null, thus we have to upload file
                    ?>
						<form name="fileuploadform" action="specupload.php" method="post" enctype="multipart/form-data" onsubmit="return verifyFileUploadForm(this)">
							<fieldset style="width:95%;">
								<legend style="font-weight:bold;font-size:120%;"><?php 
                    echo $duManager->getTitle();
                    ?>
 (Step 1)</legend>
								<div>
									<div style="margin:10px">
										<div class="ulfnoptions">
											<input name="uploadfile" type="file" size="50" onchange="this.form.ulfnoverride.value = ''" />
										</div>
										<div class="ulfnoptions" style="display:none;">
											<b>Full File Path:</b> 
											<input name="ulfnoverride" type="text" size="50" /><br/>
											* This option is for manual upload of a data file. 
											Enter full path to data file located on working server.
										</div>
									</div>
									<div style="margin:10px;">