Public gallery link

Mar 5, 2012 at 1:12 PM

Hi,

I have an application that should put a directory in de dropbox-Photos directory.

Once the directory is created and synchronized, the application needs the Public gallery Link ( which you can manually find by a right-click on the directory). Then, the application will send automatically an email to the customer with this link to his directory.

I’ve done some research with the SharpBox API but I don’t know how to find the Public gallery link.

 

Here is my code (Visual Studio 2008, SharpBox V1.2.0.542)

                Dim dropBoxStorage As New CloudStorage()

                Dim dropBoxConfig As DropBoxConfiguration = CloudStorage.GetCloudConfigurationEasy(nSupportedCloudConfigurations.DropBox)

                Dim accessToken As ICloudStorageAccessToken = Nothing

                Dim fs As New IO.FileStream("<<MyTokenFile>>", FileMode.Open, FileAccess.Read, FileShare.None)

                accessToken = dropBoxStorage.DeserializeSecurityToken(fs)

                dropBoxStorage.Open(dropBoxConfig, accessToken)

                Dim root As ICloudDirectoryEntry = dropBoxStorage.GetRoot

                Dim Photos_Map As ICloudDirectoryEntry = dropBoxStorage.GetFolder("/Photos")

                For Each fsentry As ICloudFileSystemEntry In Photos_Map

                    Try

                        If fsentry.GetType.Name = "BaseDirectoryEntry" Then

                            Dim map As ICloudDirectoryEntry = fsentry

                            Dim My_Uri As System.Uri = DropBoxStorageProviderTools.GetPublicObjectUrl(accessToken, map)

                        End If

                    Catch ex As Exception

                    End Try

                Next

                dropBoxStorage.Close()

 

I thought to find the link with GetPublicObjectUrl,but I got an exception: One or more parameters are invalid.

What is wrong with my code or is there a solution? The For each works fine and fsentry.GetType.Name = "BaseDirectoryEntry" works also fine to get ony the directories, not the files.

 

Your help is very much appreciated!

Coordinator
Mar 5, 2012 at 2:56 PM
Hi,

this API only returns the public URL of elements which are stored in the public folder. Not that I know that DropBox supports your use case via API.

Sorry
Dirk

Sent from my iPad

On 05.03.2012, at 15:12, delusoft <notifications@codeplex.com> wrote:

From: delusoft

Hi,

I have an application that should put a directory in de dropbox-Photos directory.

Once the directory is created and synchronized, the application needs the Public gallery Link ( which you can manually find by a right-click on the directory). Then, the application will send automatically an email to the customer with this link to his directory.

I’ve done some research with the SharpBox API but I don’t know how to find the Public gallery link.

Here is my code (Visual Studio 2008, SharpBox V1.2.0.542)

Dim dropBoxStorage As New CloudStorage()

Dim dropBoxConfig As DropBoxConfiguration = CloudStorage.GetCloudConfigurationEasy(nSupportedCloudConfigurations.DropBox)

Dim accessToken As ICloudStorageAccessToken = Nothing

Dim fs As New IO.FileStream("<<MyTokenFile>>", FileMode.Open, FileAccess.Read, FileShare.None)

accessToken = dropBoxStorage.DeserializeSecurityToken(fs)

dropBoxStorage.Open(dropBoxConfig, accessToken)

Dim root As ICloudDirectoryEntry = dropBoxStorage.GetRoot

Dim Photos_Map As ICloudDirectoryEntry = dropBoxStorage.GetFolder("/Photos")

For Each fsentry As ICloudFileSystemEntry In Photos_Map

Try

If fsentry.GetType.Name = "BaseDirectoryEntry" Then

Dim map As ICloudDirectoryEntry = fsentry

Dim My_Uri As System.Uri = DropBoxStorageProviderTools.GetPublicObjectUrl(accessToken, map)

End If

Catch ex As Exception

End Try

Next

dropBoxStorage.Close()

I thought to find the link with GetPublicObjectUrl,but I got an exception: One or more parameters are invalid.

What is wrong with my code or is there a solution? The For each works fine and fsentry.GetType.Name = "BaseDirectoryEntry" works also fine to get ony the directories, not the files.

Your help is very much appreciated!

Jul 5, 2013 at 9:46 AM
I have exactly the same. In the online docs it even says that the first parameter for GetPublicObjectUrl is a string with path to the token. But it's not! lol.
I get exactly the same error message and no inner exception or whatsoever. Have you solved this? It would help me a lot!
Or did you move from sharpbox to dropnet?