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...
VAR_46
10 years agoHelpful | Level 6
hey @Greg , thanks for the code now i able to share a folder, but i think the next step is to mount the folder at the added member, i want to do it automaticly from sharing can i ?
Greg-DB
Dropbox Community Moderator
10 years agoYes, as long as you're authorized as the receiving user you can use MountFolderAsync to mount the shared folder in their account.
- VAR_4610 years agoHelpful | Level 6
okay, i get it but how to get the share id is it the same way like we share the folder or i just need to use asyncidjob is complete ?, and why when i try to share file "add member selector "method that you gave to me is not working, its always return with null. and how to change its level of acces
this my code
Private Async Sub ShareFileToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ShareFileToolStripMenuItem.Click For Each C As ListViewItem In listfile.SelectedItems Dim sharefile = A.Sharing.GetFileMetadataAsync(direktori.Text & "/" & C.Text) Dim sharefileid = sharefile.Result.Id MessageBox.Show(sharefileid) Dim member = {New AddMember(New MemberSelector.Email("vincencia.ratna@gmail.com"))} Await A.Sharing.AddFileMemberAsync(file:=sharefileid, members:=member) Next End Suband the next question is how we change folder member policy ?
- Greg-DB10 years ago
Dropbox Community Moderator
The 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_4610 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
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!