Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
zainulabd786
7 years agoExplorer | Level 3
How to upload multiple files using JavaScript SDK?
Hi, I am using Javascript SDK to upload multiple files at once. I have a dropbox business account enabled and the folder where I am trying to upload the files is a shared folder.
I want to upload t...
- 7 years ago
I see, thanks for clarifying. The Dropbox API doesn't offer a way to upload multiple files in one call, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
That being the case, you will need to loop through your files and call filesUpload once per file. Apologies I don't have better news for you!
zainulabd786
7 years agoExplorer | Level 3
Okay! regarding your second point, According to documentation, "upload sessions" are meant for the files > 150MB, But in my case, The number of files is large but the size of each file is < 150MB.
Greg-DB
Dropbox Community Moderator
7 years agoUpload sessions in general are meant for larger files, but you can also use them for smaller files. That makes sense in particular when you have many files to upload at the same time, because the /2/files/upload_session/finish_batch allows you to commit multiple files at once, without causing lock contention between them. You can find more information on that under "Batch Upload" in the data ingress guide Taylor linked to.
- MatthieuWdi4 years agoNew member | Level 2
Hello guys,
I searched for a long time and found a way to make it esaylly so I hope my cade can help you.
const PHOTO_SAVE_FOLDER = 'C:/Users/matth/Desktop/' /** * eventName : foler name where are my files to upload on my computer * folder : dropbox folder name i when to save my files */ const uploadPhotosOnDropbox = async (eventName,folder) => { const errors = []; const photosInMyComputer = `${PHOTO_SAVE_FOLDER}${eventName}/${folder}/` let photosToUplaod = fs.readdirSync(photosInMyComputer); let folderPath = `/Events/${eventName}/${folder}`; // path for dropbox // create the folder in dbx, around with try/catch await dbx.filesCreateFolderV2({ path : folderPath, autorename:false}); photosToUplaod.map((photo, idx) =>{ fs.readFile(`${photosInTheBorne}${photo}`, (err, data) => { setTimeout(()=> { let path = `/Events/${eventName}/${folder}/${photo}`; const contents = data; dbx.filesUpload({ path, contents }) },idx * 2000); }); }); uploadPhotosOnDropbox('09-08-22-MATT', 'persoFolder');
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!