Upload Methods
Simple PUT Upload
Upload a file directly to a specific path:string
required
Destination path for the file
integer
required
Size of the file in bytes
string
Authentication password (alternative to
?pw= parameter)Multipart POST Upload
Upload files using standard HTML form multipart encoding:file
required
File to upload. Multiple files can be included with multiple
f parametersUpload Modifiers
Both PUT and POST uploads support these modifiers:URL Parameters
boolean
Return JSON response with upload metadata
string
default:"sha512"
Checksum algorithm. Options:
no (disable), md5, sha1, sha256, b2 (blake2b), b2s (blake2s)boolean
Overwrite existing files (requires delete permission)
boolean
Append to existing file instead of overwriting
integer
Compress with gzip. Optional compression level 0-9 (default: 9)
integer
Compress with xz/lzma. Optional compression level 0-9 (default: 1)
integer
Generate random filename with specified number of characters
integer
Auto-delete file after specified seconds (requires volume lifetime setting)
HTTP Headers
string
Response format:
url (just URL), json (full metadata)integer
Same as
?rand= parameter - generate random filenameinteger
Same as
?life= parameter - file lifetime in secondsboolean
Same as
?replace parameter - overwrite existing filesstring
Same as
?ck= parameter - checksum algorithmup2k Resumable Upload Protocol
The up2k protocol provides resumable, chunked uploads with integrity verification. It’s the most reliable method for large files.How up2k Works
- Client splits file into chunks (1-32 MiB each, max 256-4096 chunks)
- Client hashes each chunk with SHA-512
- Handshake: Client sends hashlist to server
- Server creates wark (upload identifier) and sparse file
- Client uploads chunks (can be parallel, non-sequential)
- Server validates each chunk hash
- Final handshake: Server confirms all chunks received
Chunk Size Calculation
Chunk sizes are automatically determined by file size:Step 1: Handshake (Initial)
Send file metadata and chunk hashes:string
Upload identifier - unique ID for this upload session
string
URL where file will be accessible after upload
array
List of chunk hashes that need to be uploaded (empty if file already exists)
Step 2: Upload Chunks
Upload each required chunk:string
required
Comma-separated list of chunk hashes being uploaded. Can upload multiple consecutive chunks in one request
string
required
The wark identifier from the initial handshake
integer
For partial chunk uploads - byte offset within the chunk (resumable even within a chunk)
Step 3: Final Handshake
Confirm upload completion:need: []if all chunks receivedneed: ["hash1", "hash2"]if chunks are missing (re-upload them)
Response Examples
Successful Upload (JSON)
up2k Handshake Response
Upload Features
Deduplication
up2k automatically detects duplicate files:- If file with same content exists, returns existing file URL
- Can create symlinks to duplicates (if enabled with
--dedup) - Content-based matching via SHA-512 hashes
Resume Support
- up2k uploads resume automatically if interrupted
- Re-upload same file - server skips already-received chunks
- Works even after browser/client restart
- Subchunk resume supported with
X-Up2k-Subcheader
Parallel Uploads
- up2k chunks can be uploaded in parallel
- Non-sequential upload order supported
- Improves performance on fast connections
Write-Only Folders
Withg or G permission:
- Users can upload but not browse
g: Cannot see file URLsG: Receive file URL/key after upload
Error Handling
error
Bad request - invalid parameters, missing headers, or chunk mismatch
error
Authentication required - missing or invalid credentials
error
Insufficient permissions - user lacks write access
error
File too large - exceeds volume size limits
error
Server error - disk full, permissions issue, or corruption detected