2.5 KiB
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:
-
Hyperdrive (
uploads): Stores actual file data- Each peer has their own writable drive
- Files replicate to other peers on demand
-
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
- Navigate to
https://file.dropin your browser - Drag and drop a file, or click "Choose File"
- Optionally check "Destroy after download" for one-time links
- Share the generated link
- 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.