Thu, 02 Apr 2015 23:24:32 +0200
Added ARCHIVE GET file download command.
www-thermferm/archives.php | file | annotate | diff | comparison | revisions |
--- a/www-thermferm/archives.php Thu Apr 02 22:23:18 2015 +0200 +++ b/www-thermferm/archives.php Thu Apr 02 23:24:32 2015 +0200 @@ -223,6 +223,36 @@ /* + * Download popup. The file contents is dynamic generated from + * the thermferm server. + */ +function archive_dl() { + + $name = urldecode($_GET['name']); + + header('Content-Type: text/plain'); + header('Content-Disposition: attachment; filename="'.$name.'"'); + + $answer = send_cmd('ARCHIVE GET '.$name); + $arr = explode("\r\n", $answer); + + $outstr = ''; + if (startsWith($arr[0], "212")) { + $j = 1; + while (1) { + if (strcmp($arr[$j], ".") == 0) + break; + $outstr .= $arr[$j].PHP_EOL; + $j++; + } + } + echo $outstr; + exit(); +} + + + +/* * */ function archive_dir() {