File#

class toui._signals.File(file_dict, signal, app, file_id, ws=None)[source]#

Bases: object

Contains the information of an uploaded file and can be used to save the file contents.

This object should only be created through Element.get_files() method.

name#

Name of the file.

type#

Type of the file.

size#

Size of the file.

content#

Content of the file. If the parameter with_contents in the method Element.get_files was set as True, you will be able to access the content using this attribute. Otherwise, the value of this attribute will be None.

Type:

str or None

last_modified#

The last modified date as the number of milliseconds since the Unix epoch (January 1, 1970 at midnight).

is_binary#

Set the value of this attribute to True only if you want the file content to be converted to bytes before saving it.

Type:

bool

See also

Element.get_files

Methods#

toui._signals.File.save

Saves the contents of the file to a stream.