4 % if (!defined $filename) {
6 Please note that this form expects a
7 <a href="http://explain.z3950.org/"
10 <a href="http://www.loc.gov/standards/sru/explain/"
11 >SRU explainResponse</a>.
13 <form method="post" action=""
14 enctype="multipart/form-data">
16 ZeeRex file to upload:
17 <input type="file" name="filename" size="50"/>
19 <input type="submit" name="_submit" value="Submit"/>
29 if ($r->isa('Apache2::RequestRec')) {
30 require Apache2::Request;
31 require Apache2::Upload;
32 my $req = new Apache2::Request($r);
33 my $upload = $req->upload('filename');
39 $fin = $r->upload()->fh();
43 $m->comp("/details/error.mc", msg => "Upload cancelled");
47 my $xml = join("", <$fin>);
48 my $xc = irspy_xpath_context($xml);
49 my $id = irspy_record2identifier($xc);
50 my $db = ZOOM::IRSpy::connect_to_registry();
51 my $conn = new ZOOM::Connection($db, 0,
52 user => "admin", password => "fruitbat",
53 elementSetName => "zeerex");
54 ZOOM::IRSpy::_rewrite_zeerex_record($conn, $xc->getContextNode());
61 <a href="<% xml_encode("/full.html?id=" . uri_escape_utf8($id))
62 %>">the new record</a>.