2.3.2.2. ReceiveFile
Implement this function:
- User.receive_file(filename: str, sender: str)
Accepts a
filenamethat was shared by the user with usernamesenderfor the calling user viashare_file. However, raises autil.DropboxErrorin the following circumstances:If a file with the same
filenamealready 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, onfilenameas if the file was owned by therecipientuntil their access tofilenamehas been revoked via a validrevoke_fileoperation.Note
From the perspective of the security definitions, the above paragraph means that any actions taken by the calling user on
filenameshould be regarded as confidentiality-preserving (the calling user is allowed to view the latest state offilename) and integrity-preserving (any changes made by the calling user tofilenameusingdownload_file,upload_file, andappend_filemust not result in integrity violations) up until the point at which the calling user’s access tofilenameis 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