Merge remote-tracking branch 'origin/master'
[phpmyadmin.git] / file_echo.php
blob1f6d91663bd8371bc31d41e3adf71eb11154629b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * "Echo" service to allow force downloading server status monitor settings
6 * @package PhpMyAdmin
7 */
9 define('PMA_MINIMUM_COMMON', true);
10 require_once 'libraries/common.inc.php';
12 if (isset($_REQUEST['monitorconfig'])) {
13 /* For monitor chart config export */
14 PMA_downloadHeader('monitor.cfg', 'application/json; charset=UTF-8');
15 header('X-Content-Type-Options: nosniff');
17 echo urldecode($_REQUEST['monitorconfig']);
19 } else if (isset($_REQUEST['import'])) {
20 /* For monitor chart config import */
21 header('Content-Type: application/json; charset=UTF-8');
22 header('X-Content-Type-Options: nosniff');
24 if (!file_exists($_FILES['file']['tmp_name'])) {
25 exit();
27 echo file_get_contents($_FILES['file']['tmp_name']);