<aside> 👉

Links (Object base class)

CommentObject

FileObject

TextObject

EmojiObject

FileUploadObject

UserObject

EquationObject

MentionObject

Notion Ruby Mapping Public API Reference

</aside>

Overview

NotionRubyMapping::FileUploadObject uploads a local file or asks Notion to import a file from an external URL. Creating an instance starts the upload immediately.

<aside> ⚠️

The canonical constant is NotionRubyMapping::FileUploadObject. The former top-level FileUploadObject constant is no longer provided.

</aside>

1. Constructor

NotionRubyMapping::FileUploadObject.new(fname:, external_url: nil) → FileUploadObject

Upload a local file

fuo = NotionRubyMapping::FileUploadObject.new(fname: "test.png")

Local files larger than 10 MiB are automatically divided into parts of at most 10 MiB and uploaded as a multipart upload.

Import a file from an external URL

fuo = NotionRubyMapping::FileUploadObject.new(
  fname: "sample.pdf",
  external_url: "<https://example.com/sample.pdf>",
)

The import may remain pending after construction. Use reload to retrieve the latest status.

2. Instance methods

id → String

Returns the Notion file upload ID. Pass the FileUploadObject itself to a supported block or property API; normally, applications do not need to use the ID directly.

fname → String

Returns the local path or filename supplied to the constructor.

status → String