When your user wants to hand a signed contract to a recipient, create a one-download link. The link closes after use. The recipient can still keep their downloaded copy.
A one-time download link closes after the first download. With aFile, the file is also encrypted before it leaves your machine, and the key travels in the link, not on the server.
Make one from the terminal
npm i -g @afile/cli
afile save contract.pdf
afile share contract.pdf --once --expires 2hOutput
Saved. contract.pdf 176 KiB · cdfa7753-a6e8-426e-94f6-55e7b9641389 Share it: afile share cdfa7753-a6e8-426e-94f6-55e7b9641389 Shared contract.pdf. https://api.afile.sh/s/54ab2d31-1f46-441a-a5db-e9fc824fb1bf#gNOP3q_AFm0aWdMohIDlfi2-AuM7eJp7W5r6l3ywlM0 Open until 2 Dec 23:53, for 1 download. Anyone with the whole link can download it. Close it: afile close 54ab2d31-1f46-441a-a5db-e9fc824fb1bf
aFile is made for AI agents, and the CLI works the same in your own terminal. The first save connects your machine with no account and makes its key there. The CLI needs Node.js 24 or later. If you work with an agent such as Claude Code or Codex, you can ask it in plain words instead:
Send contract.pdf to Noa. One download, two hours.
What the other person does
They open the whole link in a browser. The page decrypts the file’s name and size with the key after #, and shows a Download button. The file is decrypted in their browser too. They need no account and nothing to install.
Opening the page doesn’t use the link up. Downloading the file does. After that one download, the link closes and the encrypted copy behind it is erased.
Choose how long it stays open
--once: closes after one download.--downloads 3: closes after three.--expires 2h: closes after two hours, whatever happened. A day if you don’t say, and 30 days at most.
A link closes at whichever comes first. To close it sooner:
afile links
afile close <link>What one download protects, and what it doesn’t
- The first person to download gets it. If the link leaks before your recipient opens it, someone else can use the one download. Your recipient then finds the link closed, so you’ll know. Ask them to tell you when they have the file.
- The server can’t read it. The part of a URL after
#isn’t sent to the server, so aFile stores only ciphertext and never holds the key. Where that stops is in Share links that keep the key after #. - The link is kept in places. It stays in the chat or email you sent it through, and in the browser’s history. After the download it opens nothing, which is the point of a one-time link.
- Your own copy stays. The file is still in your aFile storage until you delete it with
afile delete contract.pdf, or until it expires, if you saved it with--expires 1d.
Other ways, and when they fit better
- magic-wormhole and croc send a file straight from one computer to another, encrypted end to end, using a short code. Both people run the tool at the same time. They fit well when the other person is technical and at their computer now.
scpandrsyncfit when you have an account on the other machine.- A one-time link fits when the other person has only a browser, and will open it when they get to it.
Questions people ask
How big can the file be?
Up to 25 MiB per file. For a folder, zip it and share the zip.
Can I see whether it was downloaded?
Yes. afile links shows each open link and how often it was used. A link that was used up no longer appears there.
Can I protect the link with a password as well?
No. The key in the link already does that job, and a password usually travels in the same message as the link anyway.
Can someone send me a file the same way?
Yes, with a receive link. See How someone can send a file to your AI agent.