We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
m4man
10 years agoExplorer | Level 3
Is it possible to upload more than one document a time? (API)
I have the following function that upload files to Dropbox:
private async Task<string> Upload(DropboxClient dbx, string localPath, string remotePath)
{
const int ChunkSize = 4096 * 1024;
using (var fileStream = File.Open(localPath, FileMode.Open))
{
if (fileStream.Length <= ChunkSize)
{
await dbx.Files.UploadAsync(remotePath, body: fileStream);
//set the expiry date
var settings = new SharedLinkSettings(expires: DateTime.Today.AddDays(7));
SharedLinkMetadata sharedLinkMetadata = await dbx.Sharing.CreateSharedLinkWithSettingsAsync(remotePath, settings);
return sharedLinkMetadata.Url;
}
else
{
await this.ChunkUpload(dbx, remotePath, fileStream, ChunkSize);
}
return "error";
}
}That works fine, but I need to upload many documents in one time and it takes long to loop through the documents and to upload them one by one, is there any option to upload a few documents at the same time?
Thanks in advance.
- Unfortunately, no, the Dropbox API doesn't offer a bulk upload method, but I'll be sure to pass this along as a feature request.
2 Replies
- Greg-DB10 years ago
Dropbox Community Moderator
Unfortunately, no, the Dropbox API doesn't offer a bulk upload method, but I'll be sure to pass this along as a feature request. - m4man10 years agoExplorer | Level 3
Thank you.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!