Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MongoDB, Elasticsearch: Allow downloading binary data

  • Loading branch information...
commit bb7331e6a0c52bb8737fca94cbd4afc43c2e2570 1 parent 60c8ec6
@vrana authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.