Ejemplo n.º 1
0
    die("Authentication required. <a href='{$auth_url}'>Click here.</a>");
}
echo "<pre>";
echo "<b>Account:</b>\r\n";
print_r($dropbox->GetAccountInfo());
$files = $dropbox->GetFiles("", false);
if (empty($files)) {
    $dropbox->UploadFile("leonidas.jpg");
    $files = $dropbox->GetFiles("", false);
}
echo "\r\n\r\n<b>Files:</b>\r\n";
print_r(array_keys($files));
if (!empty($files)) {
    $file = reset($files);
    $test_file = "test_download_" . basename($file->path);
    echo "<img src='" . $dropbox->GetLink($file, false) . "'/></br>";
    echo "\r\n\r\n<b>Meta data of <a href='" . $dropbox->GetLink($file) . "'>{$file->path}</a>:</b>\r\n";
    print_r($dropbox->GetMetadata($file->path));
    echo "{$test_file}</br>";
    echo "\r\n\r\n<b>Downloading {$file->path}:</b>\r\n";
    print_r($dropbox->DownloadFile($file, $test_file));
    echo "\r\n\r\n<b>Uploading {$test_file}:</b>\r\n";
    print_r($dropbox->UploadFile($test_file));
    echo "\r\n done!";
    echo "\r\n\r\n<b>Revisions of {$test_file}:</b>\r\n";
    print_r($dropbox->GetRevisions($test_file));
}
echo "\r\n\r\n<b>Searching for JPG files:</b>\r\n";
$jpg_files = $dropbox->Search("/", ".jpg", 5);
if (empty($jpg_files)) {
    echo "Nothing found.";
Ejemplo n.º 2
0
					</tr>
					</form>
				<?php 
    }
    echo "</table><br/><br/>";
}
?>
		</div>
		<div>
			<?php 
if (isset($_POST["view_btn"])) {
    if (isset($_POST['hiddenI'])) {
        $image = $_POST['hiddenI'];
    }
    echo "<table><tr><th><b>Image Section</b></th></tr></table><br/>";
    echo "<img height='50%' width='50%' src='" . $dropbox->GetLink($image, false) . "'/><br/>";
} elseif (isset($_POST["delete_btn"])) {
    if (isset($_POST['hiddenF'])) {
        $fileD = $_POST['hiddenF'];
    }
    $dropbox->Delete($fileD);
    $delete_file = $target_dir . basename($fileD);
    if (!unlink($delete_file)) {
        $message = 0;
    } else {
        $message = 1;
    }
    header("Location: album.php?msg={$message}");
}
?>
		</div>
Ejemplo n.º 3
0
    echo $img;
    ?>
</a></td> 
						<td><a href="?delete=<?php 
    echo $img;
    ?>
">Delete</a></td>
					</tr>
				<?php 
}
?>
				</table>
		</div>
		<div id="image-holder">
			<div id="image" style="height: auto; width: 400px; overflow: hidden; margin:auto;">
				<?php 
if (isset($_GET["img"])) {
    $show_image = $_GET["img"];
    ?>
					<img src="<?php 
    echo $dropbox->GetLink($show_image, false);
    ?>
" style="height: auto; width: 300px;">
				<?php 
}
?>
			</div>
		</div>
	</body>
</html>
Ejemplo n.º 4
0
echo "<pre>";
echo "<b>Account:</b>\r\n";
print_r($dropbox->GetAccountInfo());
$files = $dropbox->GetFiles("", False);
echo "\r\n\r\n<b>Files:</b>\r\n";
// print_r(array_keys($files));
// print_r($files);
foreach ($files as $file) {
    echo "NAME : " . basename($file->path) . "<br>";
    echo "PATH : " . $file->path . "<br>";
    echo "LAST MODIFIED : " . $file->modified . "<br>";
    if ($file->is_dir) {
        echo "<a href='#'>Open Folder</a><br>";
    } else {
        echo "SIZE : " . $file->size . "<br>";
        echo "<a href='download.php?dbxPath=" . $file->path . "'>Download</a> <a href='" . $dropbox->GetLink($file->path) . "'>Share</a> ";
        echo " <a href='delete.php?dbxPath=" . $file->path . "'>Delete</a>";
    }
    echo "<br>";
}
// if(!empty($files)) {
// $file = reset($files);
// $test_file = "test_download_".basename($file->path);
// 	echo "\r\n\r\n<b>Meta data of <a href='".$dropbox->GetLink($file)."'>$file->path</a>:</b>\r\n";
// 	print_r($dropbox->GetMetadata($file->path));
// echo "\r\n\r\n<b>Downloading $file->path:</b>\r\n";
// print_r($dropbox->DownloadFile($file, $test_file));
echo "\r\n\r\n<b>Upload:</b>\r\n";
?>
	<form method="post" action="upload.php" enctype="multipart/form-data">
		Files : <input type="file" name="upfile"><br><br>
Ejemplo n.º 5
0
    $return_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . "?auth_callback=1";
    $auth_url = $dropbox->BuildAuthorizeUrl($return_url);
    $request_token = $dropbox->GetRequestToken();
    store_token($request_token, $request_token['t']);
    die("Authentication required. <a href='{$auth_url}'>Click here.</a>");
}
echo "<pre>";
echo "<b>Account:</b>\r\n";
print_r($dropbox->GetAccountInfo());
$files = $dropbox->GetFiles("", false);
echo "\r\n\r\n<b>Files:</b>\r\n";
print_r(array_keys($files));
if (!empty($files)) {
    $file = reset($files);
    $test_file = "test_download_" . basename($file->path);
    echo "\r\n\r\n<b>Meta data of <a href='" . $dropbox->GetLink($file) . "'>{$file->path}</a>:</b>\r\n";
    print_r($dropbox->GetMetadata($file->path));
    echo "\r\n\r\n<b>Downloading {$file->path}:</b>\r\n";
    print_r($dropbox->DownloadFile($file, $test_file));
    echo "\r\n\r\n<b>Uploading {$test_file}:</b>\r\n";
    print_r($dropbox->UploadFile($test_file));
    echo "\r\n done!";
    echo "\r\n\r\n<b>Revisions of {$test_file}:</b>\r\n";
    print_r($dropbox->GetRevisions($test_file));
}
echo "\r\n\r\n<b>Searching for JPG files:</b>\r\n";
$jpg_files = $dropbox->Search("/", ".jpg", 5);
if (empty($jpg_files)) {
    echo "Nothing found.";
} else {
    print_r($jpg_files);