When the form is submitted the value for the dropbox chooser is an empty string on the server. All the other inputs’ values show fine on the server. Also, when the success event is fired for the Dropbox chooser the correct link appears on the alert.
Why is the link not reaching the backend?
Here is my client code in Jade:
extends layout
block styles
block content
.container
div#alertStage
form#shareForm.form-horizontal(method='post', action='/share', enctype='multipart/form-data')
.control-group
input(type='text', placeholder='enter class code', name='classCode', required='required')
.control-group
input(type='text', placeholder='enter professor', name='professor', required='required')
.control-group
textarea(rows='3', placeholder='enter description', name='description', required='required')
.control-group
input#db-chooser(type='dropbox-chooser', name='dropboxLink', style='visibility: hidden', data-link-type='preview')
.control-group
input#shareSubmit.btn-primary(type='submit', value='Upload')
block scripts
script(src='https://www.dropbox.com/static/api/1/dropbox.js', id='dropboxjs', data-app-key='kkobu9cjygmh6js')
script
$(document).ready(function()
{
$('#shareSubmit').on('click', function(e)
{
var message = '';
e.preventDefault();
//TODO: Validate data
$('#shareForm').submit();
});
document.getElementById("db-chooser").addEventListener("DbxChooserSuccess", function(e)
{
alert("Here's the chosen file: " + e.files[0].link)
}, false);
});
Reported this issue as a bug and it is now resolved.