cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: how to upload file asynchronously on dropbox by using php sdk with the help of ajax?

how to upload file asynchronously on dropbox by using php sdk with the help of ajax?

Maqi W.
New member | Level 1

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 1

Greg-DB
Dropbox Staff

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.

Need more support?