3 require_once 'Pman/Ftp/List.php';
5 class Pman_Ftp_View extends Pman_Ftp_List
7 //getAuth = covered by list
12 $ext = pathinfo($_SERVER['PATH_INFO'], PATHINFO_EXTENSION);
16 $fp = $this->clean($v);
18 require_once 'File/MimeType.php';
19 $fm = new File_MimeType();
20 $mt = $fm->fromExt($ext);
22 if (!isset($_REQUEST['html'])) {
23 header("Content-type: $mt");
33 case 'application/xml':
34 $fc = file_get_contents($fp);
36 if (preg_match('#^\s*<\?xml.*encoding="([^"]+)"#mi', $fc, $matches)) {
37 $fc = iconv($matches[1], "UTF8//IGNORE", $fc);
42 echo '<PRE>'. htmlspecialchars($fc) . '</PRE>';
46 echo '<img src="'. $this->baseURL.'/Ftp/View/'.$v . '">';
52 require_once 'File/Convert.php';
53 $f = new File_Convert($fp, $mt);
54 $f->convert("application/pdf"); // does no conversion (as it's the same.
56 $f->serve('attachment');
61 die("Can not handle " . $mt . " yet");