Saving files directly to Dropbox from Sitelok

You can allow users to download files using the siteloklink() function directly to their Dropbox. This can be quite useful especially for mobile users. You can read more about Dropbox Saver buttons at
First of all you need to create a simple App in your Drop box account as follows.
1) Login to the Dropbox developer area at
2) Click App Console in the left hand menu.
3) Click the Create App button.
4) Check the Drop-ins app option
5) Enter a name for the app. Anything is ok but it needs to be unique. For example Dropbox Save for
6) Add your domain name to the app ( The Save to Dropbox works only from the domain(s) you add.
7) Finally make a note of the App API key which you will need later.
Now that you have your Dropbox App created we can easily convert download links to be Save to Dropbox buttons.
1) On your page that contains the links add this line to the HEAD section replacing API KEY with your API key
<script type="text/javascript" src="" id="dropboxjs" data-app-key="API KEY"></script>

2) To convert a download link to use Dropbox we just add data-filename="" to the <a> tag of the link replacing with the appropriate filename.

For example if you have
<a href="<?php siteloklink('',1)?>"></a>
you can change it to use Dropbox like this
<a href="<?php siteloklink('',1)?>" data-filename="" ></a>

This link will now appear as a Dropbox save button on the page allowing the user to save directly to their Dropbox account. This works with files stored directly on your server and also those stored on Amazon S3.