Docs
Home
  • 🎉Welcome
    • Intro
    • Installation
  • 💾SDK
    • Upload
    • Download
    • Tokens (Client upload)
    • Publish
    • List and Search
    • Delete
  • 🚲Examples
    • File upload component (Next.js)
    • Download button (Next.js)
Powered by GitBook
On this page
  1. SDK

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.
PreviousTokens (Client upload)NextList and Search

Last updated 1 year ago

💾