Android Question Lookup failed/Incorrect offset on Upload with Dropbox API V2

stefanoa

Active Member
Licensed User
Longtime User
After finished this upload...
B4X:
    Dim session As Map
    session.Initialize
    session.Put("srcpath",dropbox_localdir)        
    session.Put("srcfile",remoteFileName)            
    session.Put("dstpath","/mylifebook")
    session.Put("dstfile",dropbox_localfilename)
    session.Put("offset",0)
    session.Put("packetsize",16384)
    dbx.UploadSessionStart(session)

i've this error and DropBox_UploadSessionFinish event does not execute:

....
JobDone(UploadSessionFinish)
JobError: lookup_failed/incorrect_offset/...

can you help me?
thanks
 

stefanoa

Active Member
Licensed User
Longtime User
ok, my test file was too small. With a bigger file it works.

But the access token that i used is my accesstoken for developer and so destination path goes to my account (developer) and not in account of user that use the app on the phone.
Where is the error? if i don't use accesstoken, i've a "bad request" for error in http authentication..
I need that destination path is in the user dropbox and not in my developer account.
thanks

B4X:
In Sub Activity_Create(FirstTime As Boolean)
    '--- DROPBOX --------------------------------
    If FirstTime = True Then
        clientID = "yyyyyyyyyyyy"
        accesstoken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ' my dev token
End If
    '--------------------------------------------------------------------------

B4X:
in Sub backupDB_Dropbox
    Log("backupDB_Dropbox")
   dbx.Initialize(Me,"DropBox",accesstoken,True)
   ...

B4X:
in Sub uploadFile

    pws.KeepAlive(True)

    Dim session As Map
       session.Initialize
       session.Put("srcpath",zipDestinationPath)     
       session.Put("srcfile",modGeneral.dropbox_remoteFileName)  
       session.Put("dstpath","/mylifebook")
       session.Put("dstfile",modGeneral.dropbox_remoteFileName)

    session.Put("offset",0)
    session.Put("packetsize",16384)
    dbx.UploadSessionStart(session)
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

stefanoa

Active Member
Licensed User
Longtime User
Upvote 0
Top