FileInfo

Table of contents

Describes a file selected using the FilePicker view

type FileInfo struct {
    LastModified time.Time
    MimeType string
    Name string
    Size int64
}
Member Type Description
LastModified time.Time Specifying the date and time at which the file was last modified
MimeType string File MIME type
Name string File name
Size int64 Size of the file in bytes
func GetFilePickerFiles(view View, subviewID ...string) []FileInfo

Returns the list of FilePicker selected files If there are no files selected then an empty slice is returned (the result is always not nil) If the second argument (subviewID) is not specified or is an empty string then selected files of the first argument (view) is returned

func GetFileSelectedListeners(view View, subviewID ...string) []func(FilePicker, []FileInfo)

Returns the "file-selected-event" listener list. If there are no listeners then the empty list is returned. If the second argument (subviewID) is not specified or is an empty string then a value from the first argument (view) is returned.

func LoadFilePickerFile(view View, subviewID string, file FileInfo, result func(FileInfo, []byte))

Loads the content of the selected file. This function is asynchronous. The "result" function will be called after loading the data. If the second argument (subviewID) is "" then the file from the first argument (view) is loaded