FlowmageDocs

Upload file

BetaChanges data

Uploads a file to Notion and attaches it to a page or a property.

Settings

SettingWhat it is
ConnectionRequiredThe Notion connection the step signs in with.
File nameRequiredThe file's name, extension included. Pick the file, then paste its base64 below.
Content typetext
File contentsRequiredBase64 of the file — {{ file("name").base64 }}. At most 20 MB here; a free Notion workspace caps a file at 5 MiB. Uploads over the "Use fixed IP address" lane are unverified; leave that toggle off for this node.
Page idRequiredThe page the file is attached to.
Attach it as"property" or "block"
Property nameThe files property's name, exactly as it reads in Notion.
Kind of block"file" or "image"
Technical details
KeyValue
connectiontexta connection id from `requires.connections` (provider `notion`)
nametexta file name, listed in `requires.files`
contentTypetext, by default "application/octet-stream"
contentBase64textits `{{ }}` must give a string
pageIdtextits `{{ }}` must give a string
attachAs"property" or "block", by default "property"
propertyNametexta value from the vendor's own list; used when `attachAs` is "property"
blockType"file" or "image", by default "file"used when `attachAs` is "block"

Output

FieldType
fileUploadIdUpload idstring
fileUploadUploadobject
attachedAttached to the pageboolean
Sample output, and the expression for each field
  • attachedtrue
  • fileUpload
    • object"file_upload"
  • fileUploadId"fu0001"

Errors

When a step of this node stops a run, the run page shows a code. Look it up:

Example step

The step as a flow file holds it. Replace each value in <…>.

{
  "config": {
    "attachAs": "property",
    "blockType": "file",
    "connection": "<connection id>",
    "contentBase64": "<file contents>",
    "contentType": "application/octet-stream",
    "name": "<file name>",
    "pageId": "<page id>",
    "propertyName": ""
  },
  "label": "Upload file",
  "type": "notion.uploadFile",
  "version": 1
}