Translated using Weblate (Finnish)
[phpmyadmin.git] / file_echo.php
blobb7d53167efd8bc2f54153f6876f89c8ff3a78891
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * "Echo" service to allow force downloading of exported charts (png or svg)
5 * and server status monitor settings
7 * @package PhpMyAdmin
8 */
10 define('PMA_MINIMUM_COMMON', true);
11 require_once 'libraries/common.inc.php';
13 if (isset($_REQUEST['monitorconfig'])) {
14 /* For monitor chart config export */
15 PMA_downloadHeader('monitor.cfg', 'application/json; charset=UTF-8');
16 header('X-Content-Type-Options: nosniff');
18 echo urldecode($_REQUEST['monitorconfig']);
20 } else if (isset($_REQUEST['import'])) {
21 /* For monitor chart config import */
22 header('Content-Type: application/json; charset=UTF-8');
23 header('X-Content-Type-Options: nosniff');
25 if (!file_exists($_FILES['file']['tmp_name'])) {
26 exit();
28 echo file_get_contents($_FILES['file']['tmp_name']);