$logFilePath = $_SESSION[$pageObject->sessionPrefix . "_tempImportLogFilePath"]; if (!myfile_exists($logFilePath)) { $data = array("success" => false); echo printJSON($data); exit; } header("Content-Type: text/plain"); header("Content-Disposition: attachment;Filename=importLog.txt"); header("Cache-Control: private"); printfile($logFilePath); exit; } if ($action == "downloadUnprocessed") { $dataFilePath = $_SESSION[$pageObject->sessionPrefix . "_tempDataFilePath"]; if (!myfile_exists($dataFilePath)) { $data = array("success" => false); echo printJSON($data); exit; } header("Content-Type: application/csv"); header("Content-Disposition: attachment;Filename=unpocessedData.csv"); printfile($dataFilePath); exit; } // add button events if exist $pageObject->addButtonHandlers(); $pageObject->addCommonJs(); $pageObject->addCommonHtml(); $hiddenBricks = array("import_rawtext_control", "import_preview", "import_process", "import_results", "error_message"); $xt->displayBricksHidden($hiddenBricks); $pageObject->display($pageObject->templatefile);
function DisplayFile() { $path = getabspath("images/file.gif"); header("Content-Type: image/gif"); printfile($path); }
return; } if (postvalue('norange') == 1) { header('Accept-Ranges: none'); header("Cache-Control: private"); header("Content-Type: " . $ftype); printDispositionHeader($fileName); header('Access-Control-Allow-Methods: HEAD, GET, POST'); SendContentLength($fsize); if ($_SERVER['REQUEST_METHOD'] == 'HEAD') { exit; } if ($isDBFile) { echoBinary($value); } else { printfile($fsFileName); } } else { $size_unit = ""; $range_orig = ""; if (preg_match('/^bytes=((\\d*-\\d*,? ?)+)$/', $_SERVER['HTTP_RANGE'])) { $tmparr = explode('=', $_SERVER['HTTP_RANGE']); $size_unit = $tmparr[0]; $range_orig = $tmparr[1]; } if ($size_unit == 'bytes') { //multiple ranges could be specified at the same time, but we accept only the first range if (strpos($range_orig, ',') !== false) { $tmparr = explode(',', $range_orig); $range = $tmparr[0]; $extra_ranges = $tmparr[1];
printer_end_page($handle); printer_end_doc($handle); */ //if(printer_write($handle, $contents)==FALSE) // echo "Can't print<br/>"; /* printer_start_doc($handle,"Source Code"); printer_start_page($handle); printer_draw_line($handle,10,10,1000,1000); printer_end_page($handle); printer_end_doc($handle); */ printer_close($handle); unlink($tmpfname); // echo $cmd; // exec($cmd); } checkauthen(); $id = $_SESSION['id']; $fsize = $_FILES['code']['size']; if ($fsize > 0 && $fsize < 10000) { $fname = $_FILES['code']['tmp_name']; printfile($id, $fname); echo "your program has been printed<br>"; } else { echo "file too big or too small<br>"; } echo "<br><br>return to <a href=\"main.php\">main page</a>";
$filename = $GLOBALS['files']->toReal($pathname); $data = file_get_contents($filename); $mime_part = new Horde_Mime_Part(Horde_Mime_Magic::filenameToMime($pathname), $data); $mime_part->setName($pathname); $viewer = $GLOBALS['injector']->getInstance('Horde_Core_Factory_MimeViewer')->create($mime_part); if ($viewer->getType() == 'text/plain') { return '<pre class="fixed">' . htmlspecialchars($viewer->render()) . '</pre>'; } else { return $viewer->render(); } } if (substr($pathname, -5) == '.html' || substr($pathname, -4) == '.htm' || Horde_Util::getFormData('raw')) { echo printfile($pathname, true); exit; } $content = printfile($pathname); if (substr($pathname, -1) == '/') { $title = sprintf(_("Directory Listing :: %s"), $pathname); $page_output->addScriptFile('tables.js', 'horde'); } else { $title = sprintf(_("Markup of %s"), $pathname); $lastmod = $index->getLastModified($pathname); if ($lastmod) { $mod_gmt = gmdate('D, d M Y H:i:s', $lastmod) . ' GMT'; header('Last-Modified: ' . $mod_gmt); header('Cache-Control: public, max-age=86400'); } if (!empty($conf['options']['use_show_var'])) { $page_output->addScriptFile('show_var.js'); } }