Latenode LogoLatenode

File uploads

To attach a file to a row via the API, first upload it, then write the response to the file field. You can upload the file itself or a link to it.

In a Latenode scenario it's simpler: the Upload File node does both steps at once. See Nodes in scenarios.

Upload a file

The request expects a multipart part named file with the file content.

curl \
-X POST \
-H "Authorization: Token YOUR_DATABASE_TOKEN" \
-F [email protected] \
"https://table.latenode.com/api/user-files/upload-file/"

Upload a file by URL

The service downloads the file from the URL in the request body.

curl \
-X POST \
-H "Authorization: Token YOUR_DATABASE_TOKEN" \
-H "Content-Type: application/json" \
"https://table.latenode.com/api/user-files/upload-via-url/" \
--data '{
  "url": "https://example.com/photo.png"
}'

What the response contains

Both requests return a file object. It contains:

  • url: file URL;
  • thumbnails: tiny and small previews, each with its own url, width, and height;
  • name: file name in storage;
  • size: size in bytes;
  • mime_type: content type;
  • is_image: whether it's an image;
  • image_width and image_height: dimensions, if it's an image;
  • uploaded_at: upload time.

You can pass this object, or at least its name, to a file field when you create or update a row. The field accepts an array of such objects, a comma-separated list of names, or an array of names.

Need Help? Ask the community

If something on this page is missing or unclear, post on the Latenode community forum. Our team and other users usually reply quickly.

0/100
0/2000