Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Maqi W.
11 years agoNew member | Level 1
how to upload file asynchronously on dropbox by using php sdk with the help of ajax?
i know how to upload files on dropbox but it causes long page reload until file is not upload i want to upload files on dropbox without page reloading as AJAX file upload do is there any way??
1 Reply
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
If you want to upload a file using AJAX client-side in the browser, you can use the JavaScript SDK:
https://www.dropbox.com/developers/datastore/sdks/js
There's a tutorial here that shows how to get started:
https://www.dropbox.com/developers/datastore/tutorial/js
The full documentation can be found here:
https://www.dropbox.com/developers/datastore/docs/js
For example, here's the method for uploading a file:
https://www.dropbox.com/developers/datastore/docs/js#Dropbox.Client.writeFile
Alternatively, if you do want to have the API call occur on your server using the PHP SDK, you could potentially upload the file from the browser to your server using an AJAX call and then pass the data to the uploadFile method of the PHP SDK:
http://dropbox.github.io/dropbox-sdk-php/api-docs/v1.1.x/class-Dropbox.Client.html#_uploadFile
Since you'd be using an AJAX call to pass the data to your server, you wouldn't need a full page reload. This part isn't specific to the Dropbox API though.
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!