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());
    }
    $transferCnt = $duManager->getTransferCount();
    $duManager->finalTransfer();
示例#2
0
if ($action == 'Automap Fields') {
    $autoMap = true;
}
$statusStr = '';
$isEditor = 0;
if ($IS_ADMIN || array_key_exists("CollAdmin", $USER_RIGHTS) && in_array($collid, $USER_RIGHTS["CollAdmin"])) {
    $isEditor = 1;
}
if ($isEditor) {
    if ($action == "Save Primary Key") {
        $statusStr = $duManager->savePrimaryKey($dbpk);
    }
}
$duManager->readUploadParameters();
$isLiveData = false;
if ($duManager->getCollInfo("managementtype") == 'Live Data') {
    $isLiveData = true;
}
//Grab field mapping, if mapping form was submitted
if (array_key_exists("sf", $_POST)) {
    if ($action == "Delete Field Mapping" || $action == "Reset Field Mapping") {
        $statusStr = $duManager->deleteFieldMap();
    } else {
        //Set field map for occurrences using mapping form
        $targetFields = $_POST["tf"];
        $sourceFields = $_POST["sf"];
        $fieldMap = array();
        for ($x = 0; $x < count($targetFields); $x++) {
            if ($targetFields[$x]) {
                $tField = $targetFields[$x];
                if ($tField == 'unmapped') {