} if (empty($blueprint)) { echo "ERROR: Missing required input \"blueprint\""; exit; } else { $blueprintSignature = $blueprint; // extract filters from Session // NOTE: requires enhancement to Session.php to allow retrieval from a named page // $filters = Session::namedPage($page, "filters"); $filters = array(); try { // read blueprint $bp = BlueprintReader::read($blueprintSignature); $bpKey = $bp->getKey(); // get export data $tar = EntityExporter::export($bp, $type, $where, $filters); } catch (Exception $e) { // return err to ajax client echo "Caught Exception: " . $e->getMessage(); exit; } // create filename $filename = $bpKey . ".{$type}"; // set headers header("Content-Type: application/x-gzip"); header("Content-Disposition: attachment; filename={$filename}"); header("Content-Transfer-Encoding: binary"); echo "{$tar}"; exit; } Log::notice("END: /blueprints/export.php" . "\n");