Public files

Host images and documents at permanent public URLs that articles, workflows and actions can link to.

Public files give an image or document a permanent public URL that needs no Octocom login and never expires. Articles, workflows and actions can link to it, for example to share a wiring diagram or a PDF guide with customers. Anyone with the URL can read the file, so publish only what is meant to be public.

The file bytes move directly between storage and the client or server. They never go into an AI model's tool arguments. Publishing a file does not add it to the knowledge base, edit articles or workflows, or publish portal pages.

From an MCP client

  1. Call create_public_file_upload_url with organizationId, businessId, filename and contentType.
  2. Upload the original local file directly to the returned presignedUrl, using HTTP PUT and the returned headers. The URL can only create the file, and it lasts 15 minutes.
  3. Call finalize_public_file_upload with the same organization and business and the returned fileId. It validates the bytes and returns publicUrl.

For a client with shell access, the transfer is a normal file upload:

curl --fail --request PUT \
  --header 'x-ms-blob-type: BlockBlob' \
  --upload-file ./wiring.png \
  "$UPLOAD_URL"

Use the exact returned upload URL. Only metadata and IDs pass through MCP; there is no base64 payload. Files can be at most 25 MiB. Until finalization succeeds, there is no public download URL. Repeating finalization after success returns the existing public export.

From Copilot

For a file already uploaded to the current Copilot session, Copilot calls publish_file(file_id, businessId). This Copilot tool finds the session file, transfers its original bytes on the server, validates them and returns the public URL, using the same upload and finalization steps.

PDFs and Word documents have readable Markdown extracts, and Excel uploads have readable CSV sheets. Publication uses the original PDF, Word document or workbook. It does not publish the extracted text under the original filename. Uploaded originals carry a server-signed source reference. If an upload has no such reference, upload the file again before publishing it.

For a new file generated in Copilot Python, register it first:

file_id = octocom_save("/mnt/data/report.pdf")
print(file_id)

Then call publish_file with that returned ID. The file is resolved from the live registry, so this works within the same turn. Copilot publication supports originals up to its 20 MiB read limit. Only files in that session's registry with verified original references can be published.

Programmatic uploads from Python

The upload URL is also useful from Copilot Python or any external program with HTTP access. After reserving the upload, send bytes directly:

import requests

with open("/mnt/data/report.pdf", "rb") as file:
    response = requests.put(upload_url, data=file, headers=upload_headers, timeout=60)
response.raise_for_status()

Then finalize using the returned file ID. When the file is already registered with octocom_save, publish_file avoids these extra steps.

Use the public URL

Insert the exact returned URL in article Markdown as an image or document link:

![Example router wiring](<returned publicUrl>)
[Download the setup guide](<returned publicUrl>)

In a workflow, specify when to show the image or link and what the customer should do with it. An action can return the URL or use an image in show_card. See Chat UI from actions.

Images: PNG, JPEG, GIF and WebP. Documents: PDF, DOCX, XLSX, XLS, PPTX, TXT, CSV and Markdown. Videos: MP4, M4V, MOV, 3GP and WebM. Raster images display inline; documents and videos download as attachments. Actual content is validated before publication. HTML, SVG and scripts, PDFs with scripts, launch or media actions or embedded files (except XML e-invoice data such as ZUGFeRD or Factur-X), and Office files with macros or embedded files are not supported. This is format validation, not a general antivirus scan.

Both the upload and finalization tools and publish_file require write access and a business in the current organization. Read-only Copilot and MCP connections, and Copilot's research subtasks, cannot publish. Finalization cannot disclose unrelated private attachments; it only accepts reservations from this public-upload flow. A validated private original remains private, and publication creates a separate public copy.

New uploads create new URLs. Replacing a file requires updating its references; removing a link does not revoke copies already cached or downloaded.

For knowledge retrieval, use upload_document or the document upload tools. For portal-page assets, use upload_portal_asset, which stays private until a published page references it. See Knowledge base and Portal assets.

On this page