5.4 User.LoadFile
LoadFile(filename string) (content []byte, err error)
Given a
filename
in the personal namespace of the caller, this function downloads and returns the content of the corresponding file.Note that, in the case of sharing files, the corresponding file may or may not be owned by the caller.
Returns an error if:
- The given
filename
does not exist in the personal file namespace of the caller.- The integrity of the downloaded content cannot be verified (indicating there have been unauthorized modifications to the file).
- Loading the file cannot succeed due to any other malicious action.
- Parameters
-
filename (string) - the name of the file
- Return
-
content ([]byte), err (error)
Do not forget that your design must satisfy all requirements, including:
- Users can have multiple active user sessions at once.