www-thermferm/archives.php

changeset 359
12734a3774e8
parent 357
64cd9865bd11
child 374
20999ef6d487
equal deleted inserted replaced
358:8b7ef338bf49 359:12734a3774e8
221 } 221 }
222 222
223 223
224 224
225 /* 225 /*
226 * Download popup. The file contents is dynamic generated from
227 * the thermferm server.
228 */
229 function archive_dl() {
230
231 $name = urldecode($_GET['name']);
232
233 header('Content-Type: text/plain');
234 header('Content-Disposition: attachment; filename="'.$name.'"');
235
236 $answer = send_cmd('ARCHIVE GET '.$name);
237 $arr = explode("\r\n", $answer);
238
239 $outstr = '';
240 if (startsWith($arr[0], "212")) {
241 $j = 1;
242 while (1) {
243 if (strcmp($arr[$j], ".") == 0)
244 break;
245 $outstr .= $arr[$j].PHP_EOL;
246 $j++;
247 }
248 }
249 echo $outstr;
250 exit();
251 }
252
253
254
255 /*
226 * 256 *
227 */ 257 */
228 function archive_dir() { 258 function archive_dir() {
229 259
230 $answer = send_cmd("ARCHIVE DIR"); 260 $answer = send_cmd("ARCHIVE DIR");

mercurial