diff options
author | Mark Crane <mcrane@pfsense.org> | 2008-12-26 19:20:14 +0000 |
---|---|---|
committer | Mark Crane <mcrane@pfsense.org> | 2008-12-26 19:20:14 +0000 |
commit | 3c773829dac7f4a71f9667b5901d530e8dfeaced (patch) | |
tree | 2f3044f35bd60b6d5b8d111afcabe15989c1287e /packages/tftp | |
parent | 5bdc36e509594d5e09d3d23f441ca08e23dfda5e (diff) | |
download | pfsense-packages-3c773829dac7f4a71f9667b5901d530e8dfeaced.tar.gz pfsense-packages-3c773829dac7f4a71f9667b5901d530e8dfeaced.tar.bz2 pfsense-packages-3c773829dac7f4a71f9667b5901d530e8dfeaced.zip |
TFTP package add file download to tftp_files.php
Diffstat (limited to 'packages/tftp')
-rw-r--r-- | packages/tftp/tftp.xml | 2 | ||||
-rw-r--r-- | packages/tftp/tftp_files.tmp | 36 |
2 files changed, 25 insertions, 13 deletions
diff --git a/packages/tftp/tftp.xml b/packages/tftp/tftp.xml index ecdd3c46..9e3fee45 100644 --- a/packages/tftp/tftp.xml +++ b/packages/tftp/tftp.xml @@ -41,7 +41,7 @@ <requirements>Describe your package requirements here</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>tftp Settings</name> - <version>0.5.1</version> + <version>0.6</version> <title>TFTP: Settings</title> <include_file>/usr/local/pkg/tftp.inc</include_file> <menu> diff --git a/packages/tftp/tftp_files.tmp b/packages/tftp/tftp_files.tmp index 65df5424..cd74bd62 100644 --- a/packages/tftp/tftp_files.tmp +++ b/packages/tftp/tftp_files.tmp @@ -1,7 +1,7 @@ <?php /* $Id$ */ /* - freeswitch_ivr.php + tftp_files.php Copyright (C) 2008 Mark J Crane All rights reserved. @@ -33,8 +33,20 @@ require("guiconfig.inc"); require("/usr/local/pkg/tftp.inc"); - -//$a_ivr = &$config['installedpackages']['freeswitchivr']['config']; +if (($_GET['a'] == "download") && file_exists("/tftpboot/".$_GET['filename'])) { + session_cache_limiter('public'); + $fd = fopen("/tftpboot/".$_GET['filename'], "rb"); + header("Content-Type: application/force-download"); + header("Content-Type: application/octet-stream"); + header("Content-Type: application/download"); + header("Content-Description: File Transfer"); + header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"'); + header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 + header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past + header("Content-Length: " . filesize($recording_dir.$_GET['filename'])); + fpassthru($fd); + exit; +} if ($_GET['act'] == "del") { @@ -79,7 +91,7 @@ include("head.inc"); <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> - <td><p><span class="vexpl"><span class="red"><strong>IVR<br /> + <td><p><span class="vexpl"><span class="red"><strong>TFTP files<br /> </strong></span> Trivial File Transport Protocol is a very simple file transfer protocol. Often used with routers, voip phones and more. @@ -91,7 +103,7 @@ include("head.inc"); <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="25%" class="listhdrr">Name</td> - <td width="50%" class="listhdr">Description</td> + <td width="50%" class="listhdr"> </td> <td width="10%" class="list"> <table border="0" cellspacing="0" cellpadding="1"> <tr> @@ -103,14 +115,19 @@ include("head.inc"); </tr> <?php - if ($handle = opendir('.')) { + if ($handle = opendir('/tftpboot')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<tr>\n"; echo " <td class=\"listlr\" ondblclick=\"\">\n"; + echo " <a href=\"tftp_files.php?a=download&filename=".$file."\">\n"; echo " $file"; + echo " </a>"; echo " </td>\n"; + echo " <td class=\"listlr\" ondblclick=\"\">\n"; + echo " "; + echo " </td>\n"; echo " <td valign=\"middle\" nowrap class=\"list\">\n"; echo " <table border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"; echo " <tr>\n"; @@ -127,11 +144,6 @@ include("head.inc"); } ?> - - - - - <tr> <td class="list" colspan="3"></td> <td class="list"> @@ -139,7 +151,7 @@ include("head.inc"); <tr> <td width="17"></td> <td valign="middle"> - a href="tftp_files_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a> + <a href="tftp_files_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a> </td> </tr> </table> |