Example #1
0
<?php

@session_start();
require_once 'ftpCon.php';
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$items = $f->readDir($_POST['path']);
if (!in_array($_POST['file'], $items)) {
    if ($_POST['path'] == '.') {
        $_POST['path'] = '';
    }
    if ($f->mkdir($_POST['path'] . $_POST['file'])) {
        ?>
    <script>
        $(document).ready(function() {
                    $('.table').DataTable().destroy();

            $('.table-arquivos').prepend('<tr>' +
                '<td><input type="checkbox" class="homeCheck"></td>' +
                '<td class="nomeArquivo"><a href="javascript:void(0);" class="diretorio" data-dir="<?php 
        echo $_POST['path'] . $_POST['file'] . DIRECTORY_SEPARATOR;
        ?>
"><i class="glyphicon glyphicon-folder-open"></i> <?php 
        echo $_POST['file'];
        ?>
</a></td>' +
                '<td class="tamanhoArquivo">------</td>' +
                '<td class="dataArquivo"><?php 
        echo date('d/M H:i');
        ?>
Example #2
0
<?php

if (!empty($_POST['newnameRename']) && strpos($_POST['newnameRename'], DIRECTORY_SEPARATOR) === false) {
    @session_start();
    $a = explode('/', $_POST['oldnameRename']);
    array_pop($a);
    $path = implode('/', $a) . DIRECTORY_SEPARATOR;
    unset($a);
    $dir = $_POST['isdirRename'] == 'true' ? true : false;
    require_once 'ftpCon.php';
    $f = new ftpCon();
    $f->conect(base64_decode($_SESSION[MD5('server')]));
    $f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
    $items = $f->readDir($path);
    if (!in_array($_POST['newnameRename'], $items)) {
        if ($f->rename($_POST['oldnameRename'], $path . $_POST['newnameRename'])) {
            $f->logout();
            if ($dir) {
                ?>
                <script>
                    $('.table').DataTable().destroy();

                    activeClick.parent().parent().find('.nomeArquivo').html('<a href="javascript:void(0);" class="diretorio" data-dir="<?php 
                echo $path . $_POST['newnameRename'] . DIRECTORY_SEPARATOR;
                ?>
"><i class="glyphicon glyphicon-folder-open"></i> <?php 
                echo $_POST['newnameRename'];
                ?>
</a>');

Example #3
0
<?php

require_once 'ftpCon.php';
include "arquivosSuportados.php";
@session_start();
$nameFile = $_POST["file"];
if ($_POST['path'] == '.') {
    $_POST['path'] = '';
}
$fileLocation = $_POST["path"];
$fp = fopen('tmptouch', 'w+');
fwrite($fp, '');
$f = new ftpCon();
$f->conect(base64_decode($_SESSION[MD5('server')]));
$f->login(base64_decode($_SESSION[MD5('user')]), base64_decode($_SESSION[MD5('password')]));
$items = $f->readDir($fileLocation);
if (!in_array($nameFile, $items)) {
    if ($f->upload($fileLocation . DIRECTORY_SEPARATOR . $nameFile, 'tmptouch')) {
        ?>
    <script>
        $(document).ready(function () {
            $('.table').DataTable().destroy();

            $('.table-arquivos').prepend('<tr>' +
                '<td><input type="checkbox" class="homeCheck"></td>' +
                '<td class="nomeArquivo"><i class="glyphicon glyphicon-file"></i> <?php 
        echo $nameFile;
        ?>
</a></td>' +
                '<td class="tamanhoArquivo">0 B</td>' +
                '<td class="dataArquivo"><?php