如何从Dropbox Chooser v2获取POST数据?

As opposed to Dropbox Chooser V2, V1 used a hidden input field making it easy for PHP to get POSTed data from form.

Using V2, however, the input fiels is gone. How do I get the POST data to further process it?

Basically two main options:

  1. You could make an AJAX call and include the URL in there.
  2. You can include a hidden input tag in your form and put the URL in there.

Rough example of the latter (completely untested, sorry for typos/bugs):

<form method="POST" action="...">
    <input id="url" name="url" type="hidden" />
    <div id="container"></div>
</form>
<script>
    var button = Dropbox.createChooseButton({
        linkType: 'direct',
        success: function (files) {
            document.getElementById('url').value = files[0].link;
        }
    });
    document.getElementById('container').appendChild(button);
</script>