Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Just programatically created a file sharing link in VB .net, once a recipient click on the link they get a message "You don’t have access to this content. You’re signed in as xxxx@xxxxx.
I just want recipient to be able to download or view uploaded file, is this possible, am I missing a step for sharing the file.
You should be able to create a shared link that anyone can access using CreateSharedLinkWithSettingsAsync. (Though, content may be subject to team and/or shared folder policies.)
Is that what you're using? Please share the code/output if something isn't working as expected.
No, for a link created using CreateSharedLinkWithSettingsAsync with the default settings, the recipient does not need to be signed in.
I use :
Private Async Function Dropboxnotification(path As [String], stream As FileStream, chunkSize As Integer, dbx As DropboxClient, filepath As String) As Task Dim updated As Task(Of ShareFolderLaunch) = Nothing updated = dbx.Sharing.ShareFolderAsync(filepath, Nothing, True) Dim myShared As Task(Of SharedFileMetadata) = Nothing myShared = dbx.Sharing.GetFileMetadataAsync(path) Dim myuploaded As ShareFolderJobStatus = Nothing Dim myPreview As SharedFolderMetadata = Nothing Dim mySharedLink As SharedLinkMetadata = Nothing Dim myDropBoxLink As String = Nothing Try If updated.Result.AsAsyncJobId.Value IsNot Nothing Then Dim myUploadReady As Boolean = False Dim myLinkReady As Boolean = False Do Until myUploadReady = True myuploaded = Await dbx.Sharing.CheckShareJobStatusAsync(updated.Result.AsAsyncJobId.Value) If myuploaded.IsComplete = True Then myPreview = myuploaded.AsComplete.Value myDropBoxLink = myPreview.PreviewUrl myUploadReady = True Exit Do End If Loop Dim myIssueID As Integer = CInt(GridView1.GetRowCellValue(GridView1.FocusedRowHandle, "Issue_ID").ToString) Dim myMembers() As AddMember = Nothing Me.Draw_issuesTableAdapter.UpdateDropboxLink(myDropBoxLink, myIssueID) GridView1.SetRowCellValue(GridView1.FocusedRowHandle, "XXXlong", myDropBoxLink) If GridView1.SelectedRowsCount > 0 Then Dim myIssueRecipientsDatatable As System.Data.DataTable Dim myIssueRecipientsTableAdapter As ArchetypeDBDataSetTableAdapters.draw_issueesTableAdapter = New ArchetypeDBDataSetTableAdapters.draw_issueesTableAdapter myIssueRecipientsDatatable = myIssueRecipientsTableAdapter.GetDataByIssueID(False, myIssueID) Try If myPreview.SharedFolderId IsNot Nothing Then For Each myIssuee As DataRow In myIssueRecipientsDatatable.Rows If myIssuee.Item("DREASON").ToString IsNot Nothing Then myMembers = {New AddMember(New MemberSelector.Email(myIssuee.Item("DREASON").ToString))} Await dbx.Sharing.AddFolderMemberAsync(myPreview.SharedFolderId, myMembers, False, "A Document Issue has been created by " & fnGetCompanyName() & " as you are part of the issue distribution, this ZipFile has been made available to you.") End If Next End If Catch ex As SystemException End Try End If End If Catch ex As System.AggregateException If ex.HResult = -2146233088 Then 'DevExpress.XtraEditors.XtraMessageBox.Show("This file already exists, cannot upload!", "oops, something has happened!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information, System.Windows.Forms.MessageBoxDefaultButton.Button1) Exit Function End If End Try End Function
I get exception that shared link aleady exists, if i try to use CreateSharedLinkWithSettingsAsync , can I return the shared link from already shared file, not the url, as the returned url needs user to be signed in.
In the code you shared here, you're getting the PreviewUrl for the shared folder, which does require members to be signed in.
If you want a shared link that anyone can access, you should use CreateSharedLinkWithSettingsAsync. If a shared link already exists, that will give you a CreateSharedLinkWithSettingsError.SharedLinkAlreadyExists, in which case you can call ListSharedLinksAsync instead to get the existing link.
The CreateSharedLinkWithSettingsAsync method can be used to create shared links for files or folders.
If you access a shared link for a zip file in particular, the Dropbox web site will allow the user to browse through the contents of the zip file.
How do I check a shared link exists, I am using
Dim mySharedFolderLink As Task(Of SharedLinkMetadata) = Nothing
mySharedFolderLink = dbx.Sharing.CreateSharedLinkWithSettingsAsync(path)
Not sure what to do next, to find out if folder exists
When calling CreateSharedLinkWithSettingsAsync, if a shared link for the requested item already exists, it will throw an ApiException with CreateSharedLinkWithSettingsError.SharedLinkAlreadyExists.
You can then call ListSharedLinksAsync to get the existing link.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!