IPWorks SSH 2020 Python Edition

Questions / Feedback?

local_file Property

The path to a local file for upload/download.

Syntax

def get_local_file() -> str: ...
def set_local_file(value: str) -> None: ...

local_file = property(get_local_file, set_local_file)

Default Value

""

Remarks

The local_file property is used by the upload and download methods. The file will only be overwritten if the overwrite property is set to True.

Example (Setting LocalFile)


SCPControl.Localfile = "C:\localfile.txt"
SCPControl.RemoteFile = "remotefile.txt"
SCPControl.Download()

SCPControl.Localfile = "C:\localfile2.txt"
SCPControl.RemoteFile = "folder/remotefile2.txt"
SCPControl.Upload()

Multiple file uploads and downloads are supported through the use of filemasks.

To upload files matching a filemask set local_file to a local path including a filemask. Set remote_path to the directory on the server where the files will be uploaded. In this case remote_file is ignored. All matching files will be upload when upload is called. The on_start_transfer, on_transfer, and on_end_transfer events provide details about the individual file transfers.

To download files matching a filemask set remote_file to a filemask. The path may be specified as part of the value in remote_file or may be set separately in remote_path. local_file should be set to a local directory where files will be downloaded. When download is called all matching files are downloaded. The on_start_transfer, on_transfer, and on_end_transfer events provide details about the individual file transfers. In the event an individual file fails to transfer the on_error event will fire.

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 Python Edition - Version 20.0 [Build 8501]