diff --git a/notion/block.py b/notion/block.py index f19784f..5c40220 100644 --- a/notion/block.py +++ b/notion/block.py @@ -640,7 +640,16 @@ def upload_file(self, path): data = self._client.post( "getUploadFileUrl", - {"bucket": "secure", "name": filename, "contentType": mimetype}, + { + "bucket": "secure", + "name": filename, + "contentType": mimetype, + "record": { + "table": "block", + "id": self.id, + "spaceId": self.space_info['spaceId'], + } + }, ).json() with open(path, "rb") as f: @@ -651,7 +660,6 @@ def upload_file(self, path): self.display_source = data["url"] self.source = data["url"] - self.file_id = data["url"][len(S3_URL_PREFIX) :].split("/")[0] class VideoBlock(EmbedOrUploadBlock):