2.3.2.2. ReceiveFile

Implement this function:

User.receive_file(filename: str, sender: str)

Accepts a filename that was shared by the user with username sender for the calling user via share_file. However, raises a util.DropboxError in the following circumstances:

  • If a file with the same filename already exists for the calling user.

  • File receiving cannot complete due to malicious action, such as an integrity violation.

Once the calling user has accepted the shared file, the calling user must have the ability to call download_file, upload_file, append_file, on filename as if the file was owned by the recipient until their access to filename has been revoked via a valid revoke_file operation.

Note

From the perspective of the security definitions, the above paragraph means that any actions taken by the calling user on filename should be regarded as confidentiality-preserving (the calling user is allowed to view the latest state of filename) and integrity-preserving (any changes made by the calling user to filename using download_file, upload_file, and append_file must not result in integrity violations) up until the point at which the calling user’s access to filename is revoked.

Parameters:
  • filename (str) – The name of the file

  • sender (str) – The username of the user who shared the file

Returns:

nothing

Raises:

DropboxError – if an error case occurred