예제 #1
0
 public function testUpload()
 {
     $test = new \classes\Upload();
     $dbxClient = new ClientMock();
     $files = array('file' => array('name' => 'test.jpg', 'type' => 'image/jpeg', 'size' => 542, 'tmp_name' => 'test.jpg', 'error' => 0));
     $this->assertNotEmpty($test->upload($files, $dbxClient, '/'));
 }
예제 #2
0
//error_reporting(E_ALL);
//ini_set('display_errors', 1);
require_once "vendor/autoload.php";
include "classes/Dir.php";
include "classes/Upload.php";
use Dropbox as dbx;
session_start();
//session_destroy();
if (isset($_SESSION['accessToken']) && $_SESSION['accessToken'] != null) {
    $accessToken = $_SESSION['accessToken'];
    $dbxClient = new dbx\Client($accessToken, 'dropboxManager/1.0');
    $begin = "/";
    $fold = isset($_GET['fold']) ? $_GET['fold'] : "";
    $qwe = new \classes\Dir();
    $dir = $qwe->dir($begin, $fold);
    $files = new \classes\Upload();
    $moveFile = $files->upload($_FILES, $dbxClient, $dir);
    $fileList = $qwe->takeList($dbxClient, $dir);
}
//
?>
<!DOCTYPE html>
<html>
<head>
    <title>Dropbox Manager</title>
    <meta charset="utf-8">
    <link href="css/bootstrap.css" rel="stylesheet" type="text/css">
    <link href="css/main.css" rel="stylesheet" type="text/css">

</head>
<body>