Couple of questions:
I implemented the authentication process with DropNet. My desktop application is designed for end-users. Every time the application is launch the little browser window pops up asking the user to confirm access... Is there any way that end-user with SOME SORT of saved credentials (or user Code +user Secret, or API code + API secret) will be able to invoke the application and not be prompted by browser form (that currently requires login - if access token expired - or confirmation)?
The goal of my application is file sharing - that is, one end user may send URL (to the file that he uploaded to DropBox) to another user and the latter should be able to download the file by clicking on the link (without any prompts, exactly like in manual process of sharing link to the file in DropBox). Is it possible? If yes, how to achieve that? THat is how do I get that URL? Redandent to say that I am looking for a programmatic way to obtain a URL that will achieve the above described)
Thanks guys, thanks for the tips, now work, The file is uploaded to a folder within the dropbox app, here's the code:
Dim client As DropNetClient
Dim dropboxLoggedIn As Boolean = False
Dim dropboxAsecret
Dim dropboxAtoken
Dim token As UserLogin
Dim url As String = ""
Private Sub test_form_Load(sender As Object, e As EventArgs) Handles MyBase.Load
client = New DropNetClient("xxxxxx", "xxxxxxx")
client.UseSandbox = True
Dim login = client.UserLogin
token = client.GetToken()
url = client.BuildAuthorizeUrl()
Process.Start(url)
End Sub
Private Sub ButtonX2_Click(sender As Object, e As EventArgs) Handles ButtonX2.Click
client.GetAccessToken()
dropboxAsecret = client.UserLogin.Secret
dropboxAtoken = client.UserLogin.Token
Try
Dim rawData As Byte() = File.ReadAllBytes("c:\flor_lotus.png")
Dim result As MetaData = client.UploadFile("/geral", "flor_lotus.png", rawData)
Catch ex As DropNet.Exceptions.DropboxException
MessageBox.Show(ex.Message)
End Try
End Sub
For starters, please read the API documentation for the Dropbox API. https://www.dropbox.com/developers/core/docs It will answer some of your questions for you.
Yes it is possible to save the authentication token to save the user logging in every time. At the end of the authentication process after calling GetAccessToken()
the DropNetClient instance will have a property called UserLogin
this contains a User token and secret. Store these, then next time you create an instance of the DropNetClient user the constructor that takes these as parameters.
The API has the ability to get a share link for a file. This is exposed by DropNet with the GetShare
and GetShareAsync
methods.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.