예제 #1
0
$FILEUPLOAD = 3;
$DWCAUPLOAD = 6;
if ($uploadType == $FILEUPLOAD) {
    $duManager = new SpecUploadFile();
    //if($filePath) ;
} elseif ($uploadType == $DWCAUPLOAD) {
    $duManager = new SpecUploadDwca();
    $duManager->setIncludeIdentificationHistory($importIdent);
    $duManager->setIncludeImages($importImage);
    if ($filePath) {
        $duManager->setPath($filePath);
    }
} else {
    exit('ERROR: illegal upload type = ' . $uploadType . ' (should be 3 = File Upload, 6 = DWCA upload)');
}
if (!$duManager->validateSecurityKey($securityKey)) {
    exit('ERROR: security key validation failed!');
}
$duManager->setVerboseMode(2);
$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();