Publish

Files are private by default, but you can make them public and share the public URL with anyone.

import { f0 } from "file0";

// Publish a file
const url = await f0.publish("hello.txt");
// https://cdn.file0.dev/onjv1is7plntb93899xm2rw3.txt

// Unpublish a file
await f0.unpublish("hello.txt");
// Public URL is no longer valid
// If the file is published again, it will get a new public URL.

Last updated