Skip to main content Link Search Menu Expand Document (external link)

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:

  1. The given filename does not exist in the personal file namespace of the caller.
  2. The integrity of the downloaded content cannot be verified (indicating there have been unauthorized modifications to the file).
  3. 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.