B4J Question how able my app users upload to own dropbox account ??

behnam_tr

Active Member
Licensed User
Longtime User
hi

i have problem with upload file to dropbox by users to their own accounts
i have this code and is ok and upload file to my own account
now i want to other users can upload file to their own accounts
how ??
B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private xui As XUI
    Private Button1 As B4XView


    Dim client As DbxClientV2
    Dim config As DbxRequestConfig
    Dim dbxFiles As DbxUserFilesRequests
    Dim token As String = "mytoken"
   
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1")
    MainForm.Show
   
    config.Initialize("",token,"","en-us",5)
    Dim dbxhost As DbxHost
    dbxhost.Initialize
    client.Initialize("Dropbox",config,token,dbxhost)
    dbxFiles = client.files
    dbxFiles.setEventname("dbxFiles")

End Sub


Private Sub dbxFiles_UploadFinished(success As Boolean, meta As FileMetadata, sessionId As String)
    Log($"dbxfiles_UploadFinished(${success}, ${sessionId})"$)

End Sub


Sub Button1_Click
   
    Dim path As String = File.DirApp
    Dim filename As String = "test.txt"
 
    dbxFiles.upload(path, filename, "/PadinaAcc/"&filename, False, False)

End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

behnam_tr

Active Member
Licensed User
Longtime User
thanks @DonManfred

i read this thread


But these commands do not exist and it is different

auth.Initialize("appkey")
auth.startOAuth2Authentication

can you give a sample for b4j ??
 
Upvote 0
Top