예제 #1
0
<?php

/**
 * @package mycms
 * @copyright bela, http://tbela.net/
 *
 * cms upload handler, cross-browser ajax file upload
 * feel free to use and/or modify
 */
defined('_JEXEC') or die('Acces denied');
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date du passé
parse_str($_SERVER['QUERY_STRING'], $match);
if (is_file($file = uploadHelper::decrypt(array_shift(array_keys($match))))) {
    if (realpath($file) == TEMP_PATH . DS . basename($file)) {
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment;filename="' . uploadHelper::safe_name(uploadHelper::getVar('filename', basename($file))) . '"');
        header('Content-Length: ' . filesize($file));
        readfile($file);
        exit;
    }
}
header('HTTP/1.0 404 Not Found');
exit;
예제 #2
0
/**
 * @package mycms
 * @copyright bela, http://tbela.net/
 *
 * cms upload handler, cross-browser ajax file upload
 * feel free to use and/or modify
 */
defined('_JEXEC') or die('Acces denied');
//defined('_JEXEC') or die('Direct access not allowed');
// require_once(dirname(__FILE__).DS.'string.php');
// require_once(dirname(__FILE__).DS.'filesystem.php');
$url = $_SERVER['REQUEST_URI'];
$self = basename($_SERVER['PHP_SELF']);
parse_str($_SERVER['QUERY_STRING'], $match);
$keys = array_keys($match);
$f_ = uploadHelper::safe_name(array_pop($keys));
$f = "'" . $f_ . "'";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>
<style type="text/css">
body { padding: 0; margin: 0 0 0 2px; margin: 0; background: transparent }
form { vertical-align:top; margin: 0 0 0 2px ; padding: 0 }
input { margin: 0; padding: 0; border: 1px }
</style>
<script type="text/javascript">

var win = parent.window,
	doc = win.document,
예제 #3
0
/**
 * @package mycms
 * @copyright bela, http://tbela.net/
 *
 * cms upload handler, cross-browser ajax file upload
 * feel free to use and/or modify
 */
defined('_JEXEC') or die('Acces denied');
//defined('_JEXEC') or die('Direct access not allowed');
// require_once(dirname(__FILE__).DS.'string.php');
// require_once(dirname(__FILE__).DS.'filesystem.php');
$url = $_SERVER['REQUEST_URI'];
$self = basename($_SERVER['PHP_SELF']);
parse_str($_SERVER['QUERY_STRING'], $match);
$f_ = uploadHelper::safe_name(array_pop(array_keys($match)));
$f = "'" . $f_ . "'";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans titre</title>
<style type="text/css">
body { padding: 0; margin: 0 0 0 2px; margin: 0; background: transparent }
form { vertical-align:top; margin: 0 0 0 2px ; padding: 0 }
input { margin: 0; padding: 0; border: 1px }
</style>
<script type="text/javascript"><?php 
/**
 * @version 2.0 {beta}
 * @author thierry bela <bntfr at yahoo dot fr>