Browse files

MongoDB, Elasticsearch: Allow downloading binary data

  • Loading branch information...
1 parent 60c8ec6 commit bb7331e6a0c52bb8737fca94cbd4afc43c2e2570 @vrana committed Jan 15, 2014
Showing with 4 additions and 1 deletion.
  1. +4 −1 adminer/download.inc.php
View
5 adminer/download.inc.php
@@ -3,5 +3,8 @@
$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

0 comments on commit bb7331e

Please sign in to comment.