Files
p2ns/docs/plugins/file.drop.md
T
2026-05-27 22:15:33 -04:00

2.5 KiB

File Drop Plugin

A P2NS plugin for temporary, peer-to-peer file sharing with automatic expiration.

Overview

File Drop enables secure, decentralized file sharing through the P2NS network. Upload a file, get a shareable link, and the file automatically expires after 24 hours. Files are stored in Hyperdrive and metadata is replicated via HyperDB across all connected peers.

Features

  • 24-Hour Expiration: Files automatically delete after 24 hours
  • Destroy on Download: Optional one-time download links
  • Peer-to-Peer Storage: Files stored in Hyperdrive with P2P replication
  • No Size Limits: Limited only by available storage
  • Shareable Links: Unique links like /d/abc123def
  • Modern UI: Clean, responsive dark theme interface

Architecture

File Drop uses two P2NS data stores:

  1. Hyperdrive (uploads): Stores actual file data

    • Each peer has their own writable drive
    • Files replicate to other peers on demand
  2. HyperDB (@filedrop/files): Stores file metadata

    • File ID, name, size, MIME type
    • Upload timestamp and expiration time
    • Drive key for locating files across peers
    • Destroy-on-download flag

API Endpoints

Endpoint Method Description
/api/upload POST Upload a file (multipart/form-data)
/api/download/:id GET Download a file by ID
/api/file/:id GET Get file metadata
/api/files GET List all active files
/d/:id GET Human-friendly download page

Usage

  1. Navigate to https://file.drop in your browser
  2. Drag and drop a file, or click "Choose File"
  3. Optionally check "Destroy after download" for one-time links
  4. Share the generated link
  5. Recipients can download until the file expires or is destroyed

Notes

  • Files uploaded on one peer are accessible to other peers via Hyperdrive replication
  • The uploader's peer must be online for remote peers to download (unless cached)
  • Cleanup runs hourly to remove expired files
  • "Destroy on download" only works when downloaded from the uploader's peer
  • For schema-affecting HyperDB metadata changes, bump plugin version (current: 1.0.7) to rotate the deterministic DB core and avoid decode mismatches across peers.

Full Documentation

For complete documentation including configuration, file structure, and HyperDB schema details, see the plugin README.