Android Question Library jkSSH2 and sub FileUploadCompleted

AlpVir

Well-Known Member
Licensed User
Longtime User
How do you use the sub FileUploadCompleted ?
I wrote
B4X:
Sub SSH_FileUploadCompleted(Success As Boolean, RemoteFile As String, LocalTargetDirectory As String, TaskId As Int)
    If Success=True Then
        msgbox ("OK","")    
    Else
       
    End If
End Sub
but it appears the error :
An error has occured in sub: java.lang.Exception: Sub ssh_fileuploadcompleted signature does not match expected signature
 

DonManfred

Expert
Licensed User
Longtime User
but it appears the error :
The signature does not match.
As seen in XML is must be

<event>FileUploadCompleted (Success As Boolean, LocalFile As String, RemoteTargetDirectory As String, Mode As String, TaskId As Int)</event>

I dont know (not using this lib) but i guess it should be something like

B4X:
Sub SSH_FileUploadCompleted(Success As Boolean, LocalFile As String, RemoteTargetDirectory As String, Mode As String, TaskId As Int))
    If Success=True Then
        msgbox ("OK","")  
    Else
     
    End If
End Sub
 
Last edited:
Upvote 0

AlpVir

Well-Known Member
Licensed User
Longtime User
Thank you for quick response. I realized that you can read the XML file libraries and obtain useful information.
However, there remains the error !
Precise that the similar function SSH2.getFile working properly.
putFile call like this:

B4X:
    If (File.Exists(File.DirRootExternal,"config.txt")) Then
                SSH2.putFile  (File.DirRootExternal & "/config.txt","/home/UGO","0666" ,22)
            Else
                Msgbox ("no","")   
            End If

B4X:
Sub SSH_FileUploadCompleted(Success As Boolean, LocalFile As String, RemoteTargetDirectory As String, TaskId As Int)
    Msgbox ("upload completato","")
    Dim C            As String
    C="config.txt"
    If Success=True Then
        File.Delete (File.DirRootExternal ,C)
        ExitApplication
    Else
       
    End If
   
End Sub
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
there remains the error
Yes, sure! You DID NOT CHANGED THE SIGNATURE! No wonder then that the error still remains.

Why you are asking for help and when you get an answer you then totally ignore it?

It is NOT fun for me if my hints are totally ignored! I´m out here. Dont expect more answers from me.
 
Last edited:
Upvote 0

AlpVir

Well-Known Member
Licensed User
Longtime User
I apologize. I read your intervention on my smartphone and I had not done too much attention; it seemed that there were no significant changes compared to what I had written myself.
I was wrong. Now everything is OK and the procedure works!
I hope you keep in mind that there is need of the most experienced and continue to improve.
Sorry again; also for my bad English.
 
Upvote 0
Top