Box is a built-in remote source in v5.2. Configure your Box OAuth client ID once,
then add 'box' to remoteSources. The browser opens a Box
OAuth popup, lists the root folder, and forwards picked files into the server-side
/import-url pipeline with a bearer token attached.
Setup required.
- Create a Box app at
app.box.com/developers/console.
- Set the OAuth 2.0 redirect URI to this page's origin.
- Configure the adapter before
create():
AjaxUploader.configureRemoteSource('box', {
clientId: 'YOUR_BOX_CLIENT_ID'
});
AjaxUploader.configureRemoteSource('box', {
clientId: 'YOUR_BOX_CLIENT_ID',
redirectUri: 'https://example.com/oauth/box/callback' // optional, defaults to current page
});
AjaxUploader.create('#uploader', {
remoteSources: ['box']
});