Pull files straight from Google Drive / Dropbox / OneDrive
CoreUpload v5 ships a pluggable remote-source registry. Built-in: Google Drive Picker (OAuth implicit flow, no server broker needed). Extend via CoreUpload.registerRemoteSource(name, source) for Dropbox, OneDrive, Box, or any custom provider. Each picked file's download URL flows into the existing /import-url endpoint with NDJSON live-progress.
What you should see: import from Google Drive alongside the local disk. Files stream from the provider through your import endpoint, so provider tokens stay server-side.
Setup required. The Google Drive button renders disabled until you configure an API key + OAuth client ID:
- Create a project at
console.cloud.google.com, enable the Picker API. - Create an API key + OAuth 2.0 Client ID (Web application). Add your origin to "Authorized JavaScript origins".
- Configure before
create():CoreUpload.configureRemoteSource('googledrive', { apiKey: 'YOUR_API_KEY', clientId: 'YOUR_OAUTH_CLIENT_ID' });
Drag & drop files here, or paste from clipboard
Registering a custom source
CoreUpload.registerRemoteSource('dropbox', {
title: 'Dropbox',
icon: '<svg ...>...</svg>',
ready: () => !!window.Dropbox,
pick: (uploader) => new Promise((resolve, reject) => {
window.Dropbox.choose({
multiselect: true,
linkType: 'direct',
success: (files) => resolve(files.map(f => ({
url: f.link, fileName: f.name, fileSize: f.bytes
}))),
cancel: () => reject(new Error('cancelled'))
});
})
});
CoreUpload.create('#uploader', {
remoteSources: ['googledrive', 'dropbox']
}); RemoteFile shape returned from pick()
{
url: 'https://www.googleapis.com/drive/v3/files/abc?alt=media',
fileName: 'quarterly-report.pdf',
fileSize: 2_457_600,
contentType: 'application/pdf',
headers: { 'Authorization': 'Bearer ya29...' }
} Wire flow
- User clicks the source button rendered in the uploader chrome.
- Adapter's
pick()opens OAuth popup + provider's native file picker. - On select -> resolves with a
RemoteFile(or array). - Each item is handed to
uploader.importFromUrl(url, { fileName, contentType, headers }). - The ASP.NET Core
/api/upload/import-urlendpoint fetches the URL (using any providedAuthorization) and streams through yourIUploaderProviderwith live NDJSON progress.
Built-in Google Drive: no server broker
Uses Google Picker + Identity Services. The browser opens the OAuth popup, gets an access token, passes it to Picker, then forwards the token as Authorization when your server fetches the file from Drive's REST API. The token never persists on your server - just the URL + the bearer.