-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathget.php
29 lines (21 loc) · 787 Bytes
/
get.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/**
* Example of getting a file
*
* description
*
* @author Sean Thomas Burke <http://www.seantburke.com>
* @tag hawaiianchimp
*/
require_once 'Dropbox.class.php'; //require the dropbox class
$dropbox = new Dropbox(); //create new dropbox object
$root = 'sandbox'; //set to the root either: 'sandbox' or 'dropbox'
$path = $_GET['path']; //path from the form
//using the GET method
echo 'Contents of: https://api-content.dropbox.com/1/files/'.$root.'/'.$path.'<br>';
echo $dropbox->get('https://api-content.dropbox.com/1/files/sandbox/test.txt'); // cUrl GET call from dropbox object
//this code uses the getFile method
echo '<br><br>'; //line space
echo 'Contents of: '.$path.'<br>';
echo $dropbox->getFile($root,'test.txt');// getFile method from Dropbox object
?>