From e9a1fed491735e551337f72c25a41ae581cac0f8 Mon Sep 17 00:00:00 2001 From: Alexander Meshcheryakov Date: Wed, 20 Jun 2018 00:22:31 +0300 Subject: Provide meaningful filenames for graphs Gives decent default name when saving graph from browser as file and distinguishable tab for tabs showing graph.php output.--- type/Base.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/type/Base.class.php b/type/Base.class.php index 70b95b5..adb8fb1 100644 --- a/type/Base.class.php +++ b/type/Base.class.php @@ -245,10 +245,13 @@ class Type_Base { if (is_numeric($this->cache) && $this->cache > 0) header("Expires: " . date(DATE_RFC822,strtotime($this->cache." seconds"))); - if ($style === 'svg') + if ($style === 'svg') { header("content-type: image/svg+xml"); - else + header('Content-Disposition: filename="' . $this->rrd_title . '.svg"'); + } else { header("content-type: image/png"); + header('Content-Disposition: filename="' . $this->rrd_title . '.png"'); + } $shellcmd = array_merge( $this->rrd_graph_command($style), -- cgit v1.1