예제 #1
0
 function fileDelete($args)
 {
     import('pages.manager.FilesHandler');
     FilesHandler::fileDelete($args);
 }
예제 #2
0
파일: ajax.php 프로젝트: basdog22/Qool
 * @author Darius Matulionis <*****@*****.**>
 */
//UPLOADIFY SESSION AUTH
//!!!! CHANGE THIS IF NEDED!!!!!!
if (!empty($_FILES) && isset($_FILES['Filedata']) && $_REQUEST['hash']) {
    require 'EncriptDecript.php';
    $ed = new EncriptDecript();
    $session_id = $ed->decript($_REQUEST['hash']);
    $_COOKIE['PHPSESSID'] = $session_id;
    session_id($session_id);
    session_start();
    $_SESSION['user_auth'] = true;
}
require_once 'config.php';
require_once 'FilesHandler.php';
$filesHandler = new FilesHandler();
//FILES UPLOAD UPLOADIFY
if (!empty($_FILES) && isset($_FILES['Filedata'])) {
    $tempFile = $_FILES['Filedata']['tmp_name'];
    $sub_dircetory = null;
    if ($_REQUEST['dir']) {
        $sub_dircetory = $_REQUEST['dir'] . "/";
    }
    $targetPath = UPLOADS_PATH . DIRECTORY_SEPARATOR . $sub_dircetory;
    $targetFile = str_replace('//', '/', $targetPath) . $_FILES['Filedata']['name'];
    move_uploaded_file($tempFile, $targetFile);
    echo str_replace($_SERVER['DOCUMENT_ROOT'], '', $targetFile);
    exit;
}
//Basic ajax requests
if (strtolower($_SERVER['REQUEST_METHOD']) != 'post') {
예제 #3
0
 function cleanFileName($var)
 {
     $var = String::regexp_replace('/[^\\w\\-\\.]/', '', $var);
     if (!FilesHandler::fileNameFilter($var)) {
         $var = time() . '';
     }
     return $var;
 }
예제 #4
0
        } else {
            if (file_exists($to)) {
                throw new Exception("Die Datei '" . $from . "' kann nicht verschoben werden. Eine Datei mit dem selben Namen existiert in dem Zielordner", 1);
            }
        }
        if (!@rename($from, $to)) {
            throw new Exception("Datei '" . $from . "' konnte aus unbekannten Gründen nicht verschoben werden");
        }
        $this->returnSuccess(null, "Datei verschoben");
    }
    protected function execHandle()
    {
        parent::execHandle();
        switch ($_SERVER["REQUEST_METHOD"]) {
            case "GET":
                $this->returnSuccess($this->getFiles($_GET['node'], isset($_GET['only_images'])));
                break;
            case "PUT":
                $this->createFolder(new Request());
                break;
            case "POST":
                $this->updateFileOrFolder(new Request());
                break;
            case "DELETE":
                $this->deleteFileOrFolder(new Request());
                break;
        }
    }
}
$handler = new FilesHandler();
$handler->handle();