cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Folders

Folders

solsupp
Explorer | Level 3

I am surrently using:

 

 Private Shared Sub FileUploadToDropbox(ByVal filePath As String, ByVal fileName As String, ByVal fileSource As String)
        Dim dbx = New DropboxClient("<REDACTED>")
        Dim fs = New FileStream(fileSource, FileMode.Open, FileAccess.Read)
        Dim updated = dbx.Files.UploadAsync((filePath + ("/" + fileName)), WriteMode.Overwrite.Instance, body:=fs)

End Sub

 

To upload a folder and file.

 

How can I then share this folder with a specific email addres, I wish to then notifiy that email address that a share has been created for them.

14 Replies 14

solsupp
Explorer | Level 3

link.SharingInfo.SharedFolderId not available in LINK, only have link.id available

 

 Dim link = dbx.Files.ListFolderAsync(filePath + ("/" + fileName)) - Is this correct

 

 

I am worndering if I am going about this the wrong way, What if I have no sharing on a folder?

 

I want to share the above folder, if its not shared, will sharedfolderID be null.

 

 

solsupp
Explorer | Level 3

Have also tried:

 

Dim slm = dbx.Files.GetMetadataAsync((filePath))
                    MsgBox(slm.Result.ParentSharedFolderId)

Returns nothing

Greg-DB
Dropbox Staff

Apologies, I believe I misread your code.

 

The SharedFolderId field is only available on folders that are shared. I see that you were actually calling GetMetadata (as far as I can tell, from the variable names you're using), so that won't be available. You should call that on the folder itself to get that instead. I.e., to get a FolderMetadata object.

 

If you call GetMetadata for a file, you will get a FileMetadata object. If the file is in a shared folder, you can get the parent shared folder ID, i.e., the shared folder ID for the shared folder the file is contained in, from FileSharingInfo.ParentSharedFolderId in FileMetadata.SharingInfo.

 

And that's correct, if the folder is not yet shared, it won't have a shared folder ID. You should call ShareFolder as discussed earlier to share a folder.

solsupp
Explorer | Level 3

Still not sure what to do here, I have searched the forum, googled it, but cant find any examples of useage anywhere?

 

Do you have an example of sharing a folder - Event if its in c#, I can convert it.  The function exmaple seems to do nothing.

 

    Public Function ShareFolderAsync(
    path As String,
    Optional aclUpdatePolicy As AclUpdatePolicy = Nothing,
    Optional forceAsync As Boolean = False,
    Optional memberPolicy As MemberPolicy = Nothing,
    Optional sharedLinkPolicy As SharedLinkPolicy = Nothing,
    Optional viewerInfoPolicy As ViewerInfoPolicy = Nothing,
    Optional actions As IEnumerable(Of FolderAction) = Nothing,
    Optional linkSettings As LinkSettings = Nothing
) As Task(Of ShareFolderLaunch)

    End Function

  ShareFolderAsync(filePath, Nothing, True, Nothing, Nothing, Nothing, Nothing, Nothing) - Folder doesn't get shared.

 

solsupp
Explorer | Level 3

got it with

 

 dbx.Sharing.ShareFolderAsync(filePath)

 

all working now

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    solsupp Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?