<!-- Built by scripts/build-agent-docs.mjs from site/agents-src/share-file.md: edit that file. -->
# Page Lemon share a file: guide for AI assistants

> For people: https://pagelemon.com/docs/share-a-file explains this feature in plain words. This page is for AI assistants.

Turning one image or PDF into its own web page with a link to send: a CV, a menu, a price list, a poster, a flyer. The page shows the file with a **Download** button. It is a new site on a `pagelemon.dev` address, owned by the person's account, so it can be renamed, protected with a passcode, archived or deleted like any other site. Publishing a whole site: https://pagelemon.com/agents/publish.

Use this when the person says "Share my CV as a file link on PageLemon.com", "Put this menu online so I can send people a link", "Make a link for this PDF", or a file they hold should be reachable by a link rather than as part of a website.

## Plans and limits

Share a file works on every plan, Free included, with an account (no anonymous use: sign in first). No single file can be over 50 MB. Live sites (each shared file is one) and deploys an hour (each share is one) depend on the plan: https://pagelemon.com/pricing. The person's own count: `account_read` `what=account` (`sites_used`, `sites_limit`).

- A file you send through the chat (`site_share_file` with `content_base64`) is at most 10 MB. A bigger one, up to 50 MB, goes through the app page.
- Each shared file is a new site: it counts as a live site, and past the number the share is refused (`403 plan_limit`, with `needs_plan` and `pricing_url`). Archive or delete a site they don't need, or give the pricing link; don't retry.
- The link works for as long as the site does: there is no expiry once it is in their account, and no limit on how many people open it.
- Accepted: PNG, JPEG, GIF, WebP, AVIF and PDF, one file at a time, checked by content, not only by name. **SVG is not accepted** (it can carry code). JPEG photos have their location removed before they are stored.
- Say plan names, never ids.

## Ask the person

Ask in one message, only what you can't tell:

1. **Which file,** and where it is: attached in this chat, on their phone, or on their computer. A chat app usually sees an attachment's text, not its bytes, so for a file the person holds the default is the app's page (below).
2. **Who may open it.** The link is public to anyone who has it. A CV or price list is fine; a document with an address, phone number or anything private may not be. Offer a passcode (a free feature, https://pagelemon.com/agents/protect).
3. **What the page is called.** The file's name becomes its title ("Maria Lopez CV.pdf"); offer to rename the file first if it has a messy name.
4. **Which workspace,** when they have more than one: a name or id from `account_read` `what=account`.

## What the person needs ready

- **The file,** in one of the accepted kinds. Where they find it: a photo is in their Photos app or camera roll; a PDF is in their Files app, their Downloads folder, an email attachment (save it first), or the chat it was made in (download it from there). If they have it as a Word, Pages or Google Docs document, they save or export it as a PDF first.
- **A free Page Lemon account, signed in.** The app page asks them to sign in with Google or their email the first time.
- **For a private file:** a passcode they choose (6 digits or a password), typed at a private link.

## Set it up

- **The file is on the person's phone or computer** (the usual case): `site_share_file` with no arguments returns `share_url` (https://dash.pagelemon.com/share). Give it to them. They sign in, pick or drop the file, and get the new address with **Copy link** and **Manage this site**. The Sites page in the app has a **Share a file** link to the same page.
- **A small file you hold yourself** (a PDF you generated, an image you made): `site_share_file` with `name` (the file name with its extension, which is also the page title) and `content` (the file as plain base64, no `data:` prefix, up to 10 MB). It publishes at once.
- **Retrying.** Send an `idempotency_key` (your own text, 1-255 characters) with the file. If the answer is lost and you call again with the same key, you get the same site back, not a second one.

```json
{"name": "Maria Lopez CV.pdf", "content": "JVBERi0xLjQK..."}
```

- The reply is a site: `site.url` (the link to send), `revision`, `file: {path, size}` and `agent_message`. Pass on the message and the link exactly. The page has the original file name as its title and heading, the image or the PDF viewer, and a **Download** button; the file itself is at `/<safe name>` on the site.

## Confirm with the person

Sharing makes the file public, so before you publish a file you made or read from the chat:

1. Say what you are about to share (the file name and what is in it) and that anyone with the link can open it and download it.
2. If it holds personal details (home address, phone, ID numbers), ask whether they want a passcode, or to remove those details first.
3. For a file the person drops themselves on the app page, they have confirmed by dropping it; just remind them the link is public.

## Test

Never hand over the link before you have looked at it:

1. Open `site.url`. It should show the file (the image, or the PDF viewer) and a **Download** button, with the file's name as the title.
2. Open the file itself at `site.url/<path from file.path>` and check it is the same size as `file.size` and downloads.
3. Tell the person the result and give them the link. A new site is served at once; a Free site is hidden from search engines for its first 7 days (so it won't show up in a search, only through the link). Free sites show a small Page Lemon badge.

## Day to day

- **A friendlier address:** rename the site (https://pagelemon.com/agents/edit): letters, digits and hyphens.
- **A new version of the file:** share it again (a new site and link), or update this site's files with the edit guide; the old link keeps showing the old file until then.
- **Make it private, take it offline, delete it:** https://pagelemon.com/agents/protect, archive, or delete in https://pagelemon.com/agents/edit.
- **The file inside their existing website** (a CV on a portfolio): not this feature. Ask for an upload link (`site_make` `action=upload_link`) and add the file to the site (https://pagelemon.com/agents/edit).
- Many files, worksheets, slide decks, long PDFs or videos: suggest keeping them in Google Drive, OneDrive, Dropbox or similar and linking them from a site.

## What Page Lemon refuses, and the fix

| Refused | Fix to offer |
|---|---|
| Not signed in (`401`) | Sign in to Page Lemon (a free account), then share |
| Not an image or PDF, or more than one file | One PNG, JPEG, GIF, WebP, AVIF or PDF at a time; export other documents as PDF |
| An SVG, or a file whose content isn't what its name says | Export the SVG as a PNG; a PDF must really be a PDF |
| Over 10 MB through the chat (`413`) | Use the app page (`share_url`), which takes files up to 50 MB |
| Over 50 MB (the largest file) | Compress or shrink it |
| Over the plan's live sites (`403 plan_limit`) | Archive or delete a site they don't need, or a bigger plan |
| In a paid workspace and no `workspace` (`needs: "workspace"`) | Ask personal or which workspace, then send `private` or the workspace |

## Links

- For the person: https://pagelemon.com/docs/share-a-file
- Editing the shared site: https://pagelemon.com/agents/edit · protecting it: https://pagelemon.com/agents/protect
- API: https://pagelemon.com/docs/api · MCP tools: https://pagelemon.com/docs/mcp
- All AI guides: https://pagelemon.com/agents
