2026-04-29 01:42:41 +03:00
|
|
|
<h3>Upload with cURL</h3>
|
|
|
|
|
<p>WarpBox accepts normal multipart form uploads through the compatibility endpoint:</p>
|
2026-04-29 02:29:49 +03:00
|
|
|
<code class="code-block">curl \
|
2026-04-29 01:42:41 +03:00
|
|
|
-F 'files=@./my-file.zip' \
|
|
|
|
|
-F 'retention=1h' \
|
|
|
|
|
{{ origin }}/upload
|
2026-04-29 02:29:49 +03:00
|
|
|
</code>
|
2026-04-29 01:42:41 +03:00
|
|
|
<h4>Browser flow</h4>
|
|
|
|
|
<p>The browser uses the manifest API: it creates a box, uploads each file, and marks failed uploads so the download page does not wait forever.</p>
|
2026-04-29 02:29:49 +03:00
|
|
|
<h4>Make a WarpBox executable</h4>
|
|
|
|
|
<p>Save this as <code>warpbox</code>, make it executable, and put it somewhere on your <code>PATH</code>.</p>
|
|
|
|
|
<code class="code-block">#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
if [ "$#" -lt 1 ]; then
|
|
|
|
|
echo "Usage: warpbox FILE [FILE ...]" >&2
|
|
|
|
|
exit 64
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
endpoint="${WARPBOX_URL:-{{ origin }}}/upload"
|
|
|
|
|
retention="${WARPBOX_RETENTION:-1h}"
|
|
|
|
|
|
|
|
|
|
args=(-F "retention=${retention}")
|
|
|
|
|
for file in "$@"; do
|
|
|
|
|
args+=(-F "files=@${file}")
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
curl "${args[@]}" "${endpoint}"
|
|
|
|
|
</code>
|
|
|
|
|
<code class="code-block">chmod +x ./warpbox
|
|
|
|
|
sudo install -m 755 ./warpbox /usr/local/bin/warpbox
|
|
|
|
|
warpbox ./my-file.zip
|
|
|
|
|
</code>
|