Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Stefano B.3
10 years agoNew member | Level 1
Upload file directly on dropbox
HI ,sorry for english, Im learning about upload a file on server to dropbox .
[code]
<?php require_once "dropbox-sdk/Dropbox/autoload.php";
use \Dropbox as dbx;
$accessToken='My_access_...
Stefano B.3
10 years agoNew member | Level 1
hi , with this javscript code :
<form onSubmit="return uploadFile()">
<input type="hidden" id="access-token" value="<?=$token ?>" />
<input type="file" id="file-upload" />
<button type="submit">Submit</button>
</form>
<!-- A place to show the status of the upload -->
<h2 id="results"></h2>
</section>
<script>
function uploadFile() {
var ACCESS_TOKEN = document.getElementById('access-token').value;
var dbx = new Dropbox({ accessToken: ACCESS_TOKEN });
var fileInput = document.getElementById('file-upload');
var file = fileInput.files[0];
dbx.filesUpload({path: '/' + file.name, contents: file})
.then(function(response) {
var results = document.getElementById('results');
results.appendChild(document.createTextNode('File uploaded!'));
console.log(response);
})
.catch(function(error) {
console.error(error);
});
return false;
}
</script>
2 answer :
1 : how i can see the list of folder's file with php or js?
2 : can i manage them with php or js ?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!