File Browser#

Synchronous API#

List#

FileBrowser.listdir(path)

List Directory

Parameters:

path (str) – Path

for item in edge.files.listdir('/'):
    print(item.name, item.fullpath)

Download#

FileBrowser.download(path, destination=None)

Download a file

Parameters:
  • path (str) – The file path on the Edge Filer

  • destination (str,optional) – File destination, if it is a directory, the original filename will be kept, defaults to the default directory

edge.files.download('cloud/users/Service Account/My Files/Documents/Sample.docx')
FileBrowser.download_many(target, objects, destination=None)

Download selected files and/or directories as a ZIP archive.

Warning

The provided list of objects is not validated. Only existing files and directories will be included in the resulting ZIP file.

Parameters:
  • target (str) – Path to the cloud folder containing the files and directories to download.

  • objects (list[str]) – List of file and/or directory names to include in the download.

  • destination (str) – Optional. Path to the destination file or directory. If a directory is provided, the original filename will be preserved. Defaults to the default download directory.

edge.files.download_many('network-share/docs', ['Sample.docx', 'Summary.xlsx'])

Create Directory#

FileBrowser.mkdir(path)

Create a new directory

Parameters:

path (str) – Directory path

edge.files.mkdir('cloud/users/Service Account/My Files/Documents')
FileBrowser.makedirs(path)

Create a directory recursively

Parameters:

path (str) – Directory path

edge.files.makedirs('cloud/users/Service Account/My Files/The/quick/brown/fox')

Copy#

FileBrowser.copy(path, destination=None, overwrite=False)

Copy a file or a folder

Parameters:
  • path (str) – Source file or folder path

  • destination (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

"""
Copy the 'Documents' folder from Bruce Wayne to Alice Wonderland
The full path of the documents folder after the copy: 'cloud/users/Alice Wonderland/My Files/Documents'
"""
edge.files.copy('cloud/users/Bruce Wayne/My Files/Documents', destination='cloud/users/Alice Wonderland/My Files')

"""Copy the file Summary.xlsx to another directory, and overwrite on conflict"""
edge.files.copy('cloud/users/Bruce Wayne/My Files/Summary.xlsx', destination='cloud/users/Bruce Wayne/Spreadsheets', overwrite=True)

Move#

FileBrowser.move(path, destination=None, overwrite=False)

Move a file or a folder

Parameters:
  • path (str) – Source file or folder path

  • destination (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

"""
Move the 'Documents' folder from Bruce Wayne to Alice Wonderland
The full path of the documents folder after the move: 'cloud/users/Alice Wonderland/My Files/Documents'
"""
edge.files.move('cloud/users/Bruce Wayne/My Files/Documents', destination='cloud/users/Alice Wonderland/My Files')

"""Move the file Summary.xlsx to another directory, and overwrite on conflict"""
edge.files.move('cloud/users/Bruce Wayne/My Files/Summary.xlsx', destination='cloud/users/Bruce Wayne/Spreadsheets', overwrite=True)

Delete#

FileBrowser.delete(path)

Delete a file

Parameters:

path (str) – File path

edge.files.delete('cloud/users/Service Account/My Files/Documents')

Asynchronous API#

Asynchronous API#

async FileBrowser.handle(path)

Get File Handle.

Parameters:

path (str) – Path to a file

async FileBrowser.handle_many(directory, *objects)

Get a Zip Archive File Handle.

Parameters:
  • directory (str) – Path to a folder

  • objects (args) – List of files and folders

async FileBrowser.download(path, destination=None)

Download a file

Parameters:
  • path (str) – The file path on the Edge Filer

  • destination (str,optional) – File destination, if it is a directory, the original filename will be kept, defaults to the default directory

async FileBrowser.download_many(target, objects, destination=None)

Download selected files and/or directories as a ZIP archive.

Warning

The provided list of objects is not validated. Only existing files and directories will be included in the resulting ZIP file.

Parameters:
  • target (str) – Path to the cloud folder containing the files and directories to download.

  • objects (list[str]) – List of file and/or directory names to include in the download.

  • destination (str) – Optional. Path to the destination file or directory. If a directory is provided, the original filename will be preserved. Defaults to the default download directory.

async FileBrowser.listdir(path)

List Directory

Parameters:

path (str) – Path

async FileBrowser.copy(path, destination=None, overwrite=False)

Copy a file or a folder

Parameters:
  • path (str) – Source file or folder path

  • destination (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

async FileBrowser.move(path, destination=None, overwrite=False)

Move a file or a folder

Parameters:
  • path (str) – Source file or folder path

  • destination (str) – Destination folder path

  • overwrite (bool,optional) – Overwrite on conflict, defaults to False

async FileBrowser.upload(name, destination, handle)

Upload from file handle.

Parameters:
  • name (str) – File name.

  • destination (str) – Path to remote directory.

  • handle (object) – Handle.

async FileBrowser.upload_file(path, destination)

Upload a file.

Parameters:
  • path (str) – Local path

  • destination (str) – Remote path

async FileBrowser.mkdir(path)

Create a new directory

Parameters:

path (str) – Directory path

async FileBrowser.makedirs(path)

Create a directory recursively

Parameters:

path (str) – Directory path

async FileBrowser.delete(path)

Delete a file

Parameters:

path (str) – File path