The file handler

All media files, files that are played or recorded, are stored on the cloud. This API provides some simple management tools to access those files. A separate web services API provides the ability to upload and download files between your local machine and the cloud.

You can also have a look at some of the web services samples that are provided.

It is important that you also read the section about media files which describes some of the effects of Eventual Consistency.

class UASFileManagement
exists(filename)

Check whether a file exists.

Required argument:
  • filename

    the name of the file to check. Wildcards are not permitted.

This method is provided to confirm the presence of a file on the Aculab Cloud.

If the file is present, this function will return True; otherwise, it will return False.

Usage example:

if file_man.exists("my_directory") is False:
    print("my_directory does not exist")
delete_file(filename)

Delete a file.

Required argument:
  • filename

    the name of the file to delete. Wildcards are not permitted.

This method is provided to delete a file from the Aculab Cloud.

If successful, this function will return True; if unsuccessful, it will return False.

Usage example:

if file_man.exists("my_directory") is True:
    file_man.delete_file("my_directory/my_file")
rename(current_name, new_name)

Rename and/or move a file.

Required argument:
  • current_name

    the name of the file to rename.

  • new_name

    the new name of the file.

This method is provided to rename a file on the Aculab Cloud.

If successful, this function will return True, otherwise it will return False.

Usage example:

if file_man.exists("my_file") is True:
    file_man.rename("my_file", "your_file")

Previous topic

The DTMFDetector property

Next topic

The Web Services API