5.7. User.ReceiveFile: Add a shared file to personal file namespace

ReceiveFile(filename string, sender string, accessToken UUID) (error)

Adds a file that was previously shared with the caller (i.e. the recipient) to the personal file namespace of the caller.

Returns an error if:

  • the secure file share invitation pointed to by accessToken has been revoked; or

  • the recipient already has a file with the given filename in their personal file namespace; or

  • the recipient is unable to verify that the secure file share invitation pointed to by the given accessToken was sent by the given sender; or

  • the recipient is unable to verify the integrity of the secure file share invitation pointed to by the given accessToken.

Parameters
  • filename (string) – The filename that the recipient would like to assign to the shared file in their personal file namespace.

  • sender (string) – The username of the sender.

  • accessToken (UUID) – The UUID storage key at which the sender’s secure file share invitation is stored in the Datastore.

Return type

error

Warning

Do not forget that your design must satisfy all requirements, including:

  1. There must only be a single copy of the file (see Sharing and Revoking #2).

  2. All Access Tokens requirements.

  3. Users can have multiple active user sessions at once (see User Sessions).