<aside> 👉 Links (Object base class)
Notion Ruby Mapping Public API Reference
</aside>
[PARAM] fname
file name (String)
[PARAM] external_url
external url
# Create a FileUploadObject by specifying a local filename
# If the file size exceeds 10MB, it will be automatically divided into 10MB parts and sent as multipart within the framework
fuo_by_file = FileUploadObject.new fname: "test.png"
=> #<FileUploadObject:XXXXXXXXXXXXXXXXXXX
# When an external URL is specified, Notion's server automatically imports it
fuo_by_url = FileUploadObject.new fname: "test.mp4", external_url: "https://..../test.mp4"
=> #<FileUploadObject:YYYYYYYYYYYYYYYYY
# You can verify the upload completion by checking the status with reload. (for external URL only)
while fuo_by_url.reload.status == "pending"
sleep 15
end
Reloads to update the file upload status.
fuo_by_url.reload
=> #<FileUploadObject:YYYYYYYYYYYYYYYYY
Checks the file upload status.
fuo_by_url.status
=> "pending"
fuo_by_url.reload.status
=> "uploaded"