]> git.joonet.de Git - adminer.git/commitdiff
MongoDB, Elasticsearch: Allow downloading binary data
authorJakub Vrana <jakub@vrana.cz>
Wed, 15 Jan 2014 16:26:47 +0000 (08:26 -0800)
committerJakub Vrana <jakub@vrana.cz>
Wed, 15 Jan 2014 16:26:47 +0000 (08:26 -0800)
adminer/download.inc.php

index f41bbdc6a711a61972ad8a5df492fc66a3c245d9..b1aea655a193724b138978eb409faea37e399830 100644 (file)
@@ -3,5 +3,8 @@ $TABLE = $_GET["download"];
 $fields = fields($TABLE);
 header("Content-Type: application/octet-stream");
 header("Content-Disposition: attachment; filename=" . friendly_url("$TABLE-" . implode("_", $_GET["where"])) . "." . friendly_url($_GET["field"]));
-echo $connection->result("SELECT" . limit(idf_escape($_GET["field"]) . " FROM " . table($TABLE), " WHERE " . where($_GET, $fields), 1));
+$select = array(idf_escape($_GET["field"]));
+$result = $driver->select($TABLE, $select, array(where($_GET, $fields)), $select);
+$row = ($result ? $result->fetch_row() : array());
+echo $row[0];
 exit; // don't output footer