Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
VAR_46
10 years agoHelpful | Level 6
How we share folder and file ?, via dropbox api
okay i start from scratch "again", how i can share file and folder via dropbox api, i think some sharing flow, 1. get the file and folder id, ( i already try it, show just two digit number) 2. c...
Greg-DB
Dropbox Community Moderator
10 years agoThe MountFolderAsync method takes a shared folder ID, which is the same as the sharedFolderId value from my code sample.
You can also use ListMountableFoldersAsync/ListMountableFoldersContinueAsync to list the folders available to mount in an account.
Your latest sample instead seems to just be getting the ID of a file, not a shared folder ID. Also, it appears you're trying to use AddFileMemberAsync, which is different from AddFolderMemberAsync anyway.
The AddFileMemberAsync method does take a file path or ID. Here's a sample for AddFileMemberAsync that works for me:
var members = new[] { new MemberSelector.Email("email@example.com") };
await client.Sharing.AddFileMemberAsync ("/test.txt", members);
What specifically wasn't working for you? One thing I notice that may be a problem in your code is that you're building an array of AddMember, but AddFileMemberAsync just takes an array of MemberSelector.
VAR_46
10 years agoHelpful | Level 6
okay greg, your code work, now my problem is why i cant share mp3 ? , are there some file format that dropbox api doesnt support to share ?, and now i stil try to show the list of mountable folder, and mount it as reciever. i confuse how to retrieve the list. this is the las feature of my basic dropbox vb application, i interested to upgrade my application further with more robust API.
now the question is
1. what file extension dropbox support to add member beside txt ?
2. how to get the list of mountable folder -> get the share id -> and mount it
- Greg-DB10 years ago
Dropbox Community Moderator
1) The file extension doesn't matter. You can share any file type. Are you getting an error when trying to share a different file?
2) You can use ListMountableFoldersAsync/ListMountableFoldersContinueAsync to list the folders available to mount in an account. You can then use MountFolderAsync to mount folders using the returned SharedFolderMetadata.SharedFolderId.
- VAR_4610 years agoHelpful | Level 61. Hi greg, when i try to add member to a jpg file it's return with dropbox api exception 1, is it some thing wrong or i must use share link ?.
2. Yes i know, the ricght code is listmountablefolderasync but the code i still confuse how to implement at code a cause this list is different with listfile async- Greg-DB10 years ago
Dropbox Community Moderator
1. What exception are you getting specifically?
2. What do you have so far? What are you stuck on?
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!