B4J Question SFTP and Wait for

Discussion in 'B4J Questions' started by imbault, Jul 10, 2019.

  1. imbault

    imbault Well-Known Member Licensed User

    Hi,
    Is there a way to do a wait for using SFTP, because I do not see any return object in the oSFTP.UploadFile ?

    Thanks
     
  2. José J. Aguilar

    José J. Aguilar Active Member Licensed User

  3. imbault

    imbault Well-Known Member Licensed User

    FTP.UploadFile returns an object, which is not the case of oSFTP.UploadFile
     
  4. MarkusR

    MarkusR Well-Known Member Licensed User

    should be an event UploadCompleted,
    so you would wait for this event.
    https://www.b4x.com/b4j/help/jsch.html#sftp_uploadfile
     
    José J. Aguilar likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

    You can always wait for events, even if there is no "sender filter" object.

    Code:
    SFTP.UploadFile(...)
    Wait For SFTP_UploadCompleted (...)
    This will work as long as you are not trying to upload multiple files at once. In that case only the last event will be raised.
     
  6. imbault

    imbault Well-Known Member Licensed User

    thank you Erel, that's clear

    Patrick
     
  7. imbault

    imbault Well-Known Member Licensed User

    Sorry Erel, what kind of paramaters do I have to put in (....) for
    Wait For SFTP_UploadCompleted (...)
    ?

    Thanks
     
  8. Enrique Gonzalez R

    Enrique Gonzalez R Well-Known Member Licensed User

    you can use the TAB key to enter the library events as if you were creating a new sub. anyway it is exactly the same parameters (you can change names of them) as a regular sub
     
  9. imbault

    imbault Well-Known Member Licensed User

    SFTP_UploadCompleted is a self called sub
     
  10. DonManfred

    DonManfred Expert Licensed User

    The event is raised from the library when a upload finishes

    See the documentation for a list of all events and their signature!
    https://www.b4x.com/b4j/help/jsch.html#sftp

    Given you did set the eventprefix to sftp then its signature is
    Code:
    sub sftp_UploadCompleted (ServerPath As String, Success As Boolean)
    end sub
     
    Erel likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice