2026-04-29 11:51:04 +03:00
< h3 > < u > Upload Files from Terminal< / u > < / h3 >
< p > WarpBox accepts normal multipart uploads at < strong > < u > /upload< / u > < / strong > . The server returns JSON with a < code > box_url< / code > you can open or share.< / p >
< div style = "background:#ffffff; border-top:1px solid #808080; border-left:1px solid #808080; border-right:1px solid #ffffff; border-bottom:1px solid #ffffff; padding:10px; margin:10px 0;" >
< p > < strong > > Quick Upload:< / strong > Use this command to upload a single file:< / p >
< pre class = "code-block" > < code > curl \
-F 'files=@./my-file.zip' \
-F 'retention=1h' \
{{ origin }}/upload< / code > < / pre >
< / div >
< h4 > < u > Reusable Shell Wrapper< / u > < / h4 >
< p > This version is small, portable, and works well as a personal < strong > < u > warpbox< / u > < / strong > command.< / p >
< div style = "background:#ffffff; border-top:1px solid #808080; border-left:1px solid #808080; border-right:1px solid #ffffff; border-bottom:1px solid #ffffff; padding:10px; margin:10px 0;" >
< p > < strong > > Save this as a file< / strong > called < strong > < u > warpbox< / u > < / strong > and make it executable to use it as a command:< / p >
< pre class = "code-block" > < code > #!/usr/bin/env bash
2026-04-29 02:29:49 +03:00
set -euo pipefail
if [ "$#" -lt 1 ]; then
2026-04-29 11:51:04 +03:00
echo "Usage: warpbox FILE [FILE ...]" >& 2
exit 64
2026-04-29 02:29:49 +03:00
fi
endpoint="${WARPBOX_URL:-{{ origin }}}/upload"
retention="${WARPBOX_RETENTION:-1h}"
args=(-F "retention=${retention}")
for file in "$@"; do
2026-04-29 11:51:04 +03:00
args+=(-F "files=@${file}")
2026-04-29 02:29:49 +03:00
done
2026-04-29 11:51:04 +03:00
curl --fail-with-body "${args[@]}" "${endpoint}"< / code > < / pre >
< / div >
2026-04-29 02:35:23 +03:00
2026-04-29 11:51:04 +03:00
< h4 > < u > Install the Command< / u > < / h4 >
2026-04-29 02:35:23 +03:00
< p > Put the wrapper somewhere on your < code > PATH< / code > , then call it with one or more files.< / p >
2026-04-29 11:51:04 +03:00
< div style = "background:#ffffff; border-top:1px solid #808080; border-left:1px solid #808080; border-right:1px solid #ffffff; border-bottom:1px solid #ffffff; padding:10px; margin:10px 0;" >
< p > < strong > > Install Steps:< / strong > < / p >
< ol >
< li > Make the script executable: < code > chmod +x ./warpbox< / code > < / li >
< li > Install to system path: < code > sudo install -m 755 ./warpbox /usr/local/bin/warpbox< / code > < / li >
< li > Use it: < code > warpbox ./photo.png ./archive.zip< / code > < / li >
< / ol >
< / div >
< h4 > < u > Print Only the Share URL< / u > < / h4 >
< p > If < strong > < u > jq< / u > < / strong > is installed, this variant extracts the returned link and expands it to a full URL.< / p >
< div style = "background:#ffffff; border-top:1px solid #808080; border-left:1px solid #808080; border-right:1px solid #ffffff; border-bottom:1px solid #ffffff; padding:10px; margin:10px 0;" >
< p > < strong > > Function Version:< / strong > Add this function to your shell profile (like < strong > < u > ~/.bashrc< / u > < / strong > or < strong > < u > ~/.zshrc< / u > < / strong > ):< / p >
< pre class = "code-block" > < code > warpbox() {
local endpoint="${WARPBOX_URL:-{{ origin }}}/upload"
local retention="${WARPBOX_RETENTION:-1h}"
local args=(-F "retention=${retention}")
for file in "$@"; do
args+=(-F "files=@${file}")
done
curl --fail-with-body -sS "${args[@]}" "${endpoint}" |
jq -r --arg origin "${WARPBOX_URL:-{{ origin }}}" '"\($origin)\(.box_url)"'
}< / code > < / pre >
< / div >
< h4 > < u > Add Password or Retention< / u > < / h4 >
< p > You can keep the wrapper simple and pass fixed options through < strong > < u > environment variables< / u > < / strong > or extra form fields.< / p >
< div style = "background:#ffffff; border-top:1px solid #808080; border-left:1px solid #808080; border-right:1px solid #ffffff; border-bottom:1px solid #ffffff; padding:10px; margin:10px 0;" >
< p > < strong > > Examples:< / strong > < / p >
< p > Set < u > retention period< / u > for one upload:< / p >
< pre class = "code-block" > < code > WARPBOX_RETENTION=24h warpbox ./release.tar.gz< / code > < / pre >
< p > Add < u > password protection< / u > to a specific upload:< / p >
< pre class = "code-block" > < code > curl \
-F 'files=@./private.zip' \
-F 'retention=1h' \
-F 'password=correct-horse-battery-staple' \
{{ origin }}/upload< / code > < / pre >
< / div >