The gived credentials or configuration format does not fits to the storage provider

Dec 14, 2014 at 6:49 PM
Edited Dec 14, 2014 at 6:50 PM
Hello everyone I am new to cloud storage , I came up with this error "The gived credentials or configuration format does not fits to the storage provider" when I tried to read a txt file with token (uploadMe sub).Looking forward for your reply
My Code :
Dim ConsumerKey As String = "******************"
Dim ConsumerSecret As String = "*****************"
Dim config As DropBoxConfiguration = DropBoxConfiguration.GetStandardConfiguration()
Dim requestToken As DropBoxRequestToken

  Private Sub AuthorizeMe()
    config.AuthorizationCallBack = New Uri("")
    requestToken = DropBoxStorageProviderTools.GetDropBoxRequestToken(config, ConsumerKey, ConsumerSecret)
    Dim AuthorizationUrl As String = DropBoxStorageProviderTools.GetDropBoxAuthorizationUrl(config, requestToken)
End Sub

   Private Sub saveMyAuth()
    Dim accessToken As ICloudStorageAccessToken = DropBoxStorageProviderTools.ExchangeDropBoxRequestTokenIntoAccessToken(config, ConsumerKey, ConsumerSecret, requestToken)
    Dim DropboxStorage As New CloudStorage()
    DropboxStorage.Open(config, accessToken)

    Dim File As FileStream = New FileStream("c:\TEMP\MyToken.txt", FileMode.Create, System.IO.FileAccess.Write)
    DropboxStorage.SerializeSecurityTokenToStream(requestToken, File)
End Sub

Private Sub uploadme()
        Dim configio As DropBoxConfiguration = CloudStorage.GetCloudConfigurationEasy(nSupportedCloudConfigurations.DropBox)
        Dim DropboxStorage As New CloudStorage()
        Dim accessToken As ICloudStorageAccessToken
         Using fs = File.Open("C:\TEMP\MyToken.txt", FileMode.Open, FileAccess.Read, FileShare.None)

            accessToken = DropboxStorage.DeserializeSecurityToken(fs)
        End Using
        DropboxStorage.Open(configio, accessToken)
        Dim srcFile = Environment.ExpandEnvironmentVariables("C:\TEMP\mysqlbackup.xml")
        DropboxStorage.UploadFile(srcFile, "/")
    Catch ex As Exception
        Console.Write(ex.Message, "")
    End Try
End Sub