1. Home
  2. Docs
  3. Manual
  4. Playbook
  5. Command list
  6. FileTransferCommand component

FileTransferCommand component

Obtain the file content of the remote session.
Because it is executed asynchronously, in order to facilitate collaboration with async/await, a JS interface with the same name but lowercase initial is encapsulated. The specific source code is as follows: https://github.com/aoyiduo/woterm/blob/main/woterm/js/async.js
Its reference example:
https://github.com/aoyiduo/woterm/blob/main/private/playbooks/test/TestFileTransferCommand.qml

The core code is as follows:

import FileTransferCommand 1.0

FileTransferCommand {
   id: fileTransfer
}

asyncGenerator(function*(){
    Playbook.log("ready to upload---------")
    yield fileTransferCommand(fileTransfer, fileLocal.text, fileRemote, false, false)
    Playbook.log("success to upload----------")
})()

The Property list is as follows:
QString fileLocal:[readable / writable],Set the path for uploading or saving local files.
QString fileRemote:[readable / writable],Set the path for remote file saving or downloading.
bool fileAppend: [readable / writable],Breakpoint continuation upload or download.
bool fileDownload: [readable / writable],Set up file download or upload.