notion-py icon indicating copy to clipboard operation
notion-py copied to clipboard

Upload a file in a "file" type column in a table.

Open AsukaVPD opened this issue 4 years ago • 3 comments

I enjoy the great features of this package.

To upload a file, I can use the FileBlock class and the upload_file method. When the FileBlock is a child of a page, the uploaded file is shown as a block on a page. I can attach a FileBlock as a child of a row of a table, and then the uploaded file is shown as an icon on the title column.

When a column is set as a "file" type, I can upload a file to the column from web. But, can I do this from this API?

I uploaded a file directly following the code of the upload_file method, and I added the url to the file-type column. I found that the link appeared but did not work; a ValidationError returned as a json file with a message "User does not have access."

AsukaVPD avatar Dec 02 '20 18:12 AsukaVPD

Hi Asuka, do you have solved this problem? I want to add files to a column as well. Thank you

AndreClaassen1 avatar Jan 07 '21 06:01 AndreClaassen1

when i set the file property to the FileBlock.source, i get the following when trying to view the file in a web browser

{"errorId":<errorId>,"name":"ValidationError","message":"User does not have access."}

che-co avatar Jan 17 '21 07:01 che-co

this solution worked for me: https://github.com/jamalex/notion-py/issues/75

che-co avatar Jan 17 '21 19:01 che-co