Pick files straight from Box.com (enterprise content cloud)
Built-in Box adapter. OAuth 2.0 implicit flow in a popup; lists the user's root folder and surfaces a clean picker UI. Returns RemoteFile[] with bearer-token-authorized download URLs that your server's /import-url endpoint can fetch with NDJSON live progress. Completes the enterprise cloud-picker quartet: Google Drive + Dropbox + OneDrive + Box.
Setup required. Create a Box app at app.box.com/developers/console (Custom App -> User Authentication (OAuth 2.0)). Set the redirect URI to your origin, then configure:
MultipleUpload.configureRemoteSource('box', {
clientId: 'YOUR_BOX_CLIENT_ID',
redirectUri: window.location.origin // optional; auto-derived if omitted
}); Returned RemoteFile shape
{
url: 'https://api.box.com/2.0/files/123456789/content',
fileName: 'enterprise-report.pdf',
fileSize: 2_457_600,
headers: { 'Authorization': 'Bearer abc123...' } // attached when fetching
}Auth flow
- User clicks the Box button rendered by
remoteSources: ['box']. - Adapter opens a popup -> Box's OAuth 2.0 implicit-grant screen.
- On approve, Box redirects to your
redirectUriwith#access_token=...in the URL fragment. - Adapter detects the redirect (polling
popup.location.hrefuntil same-origin), extracts the token, closes the popup. - Fetches the user's root folder listing via the Box REST API.
- Renders a minimal picker modal with checkbox / radio selection.
- Picked files resolve as
RemoteFile[]withAuthorizationheaders attached. - Each file flows into
uploader.importFromUrl(url, { headers })-> your server fetches the bytes from Box using the bearer.
Cloud picker quartet
| Source | Auth | Picker UI | Setup |
|---|---|---|---|
'googledrive' | OAuth (gsi) | Google Picker (full-featured) | { apiKey, clientId } |
'dropbox' | OAuth (popup) | Dropbox dropins.js | { appKey } |
'onedrive' | OAuth (popup) | OneDrive.js v7.2 | { clientId } |
'box' | OAuth (popup) | Built-in minimal picker (root folder) | { clientId } |
Mix and match
// One uploader, all four cloud sources side by side
new MultipleUpload('#uploader', {
remoteSources: ['googledrive', 'dropbox', 'onedrive', 'box']
});
// Plus your own custom adapter
MultipleUpload.registerRemoteSource('internal-cms', {
title: 'Company CMS',
icon: '<svg .../>',
pick: async (uploader) => {
const picked = await openMyCmsPicker();
return picked.map(p => ({ url: p.cdnUrl, fileName: p.name }));
}
});Why a built-in picker UI for Box
Box doesn't ship an official browser-side file-picker SDK like Dropbox / OneDrive / Drive - historically integrators have had to roll their own. The built-in adapter ships a minimal modal that lists the user's root folder with checkbox selection. For deeper navigation (subfolders, search), override the adapter:
MultipleUpload.registerRemoteSource('box', {
title: 'Box (custom)',
icon: '<svg .../>',
ready: () => !!myCustomBoxConfig.clientId,
pick: myCustomBoxFlow // your richer picker
});