Upload files from the terminal with curl

Send a file from any server, laptop or CI job with one command. No account, no API key, no install. You get back a link you can paste anywhere.

curl -T report.pdf https://file2share.us
# → https://file2share.us/download/K3J9QX2ZLM

The response body is just the link, so it works inside scripts: link=$(curl -sT build.zip https://file2share.us). Files are kept for 14 days and then deleted automatically.

Examples

Upload and choose when it expires

curl -H "Max-Days: 2" -T backup.tar.gz https://file2share.us

Max-Days can be 1 to 14. After that the file and its link are removed.

Get the direct download link and delete link

curl -sD - -T photo.jpg https://file2share.us | grep -iE '^(x-direct-url|x-delete-url)'
# x-direct-url: https://file2share.us/storage/uploads/AB12C/photo.jpg
# x-delete-url: https://file2share.us/K3J9QX2ZLM/<secret-token>

The direct URL works with wget and curl -O on the receiving machine. Keep the delete URL private; anyone who has it can remove the file:

curl -X DELETE https://file2share.us/K3J9QX2ZLM/<secret-token>

Upload from a pipe

tar czf - ./logs | curl -T - https://file2share.us/logs.tar.gz

When reading from stdin, put the file name you want at the end of the URL.

Files bigger than 95 MB: the f2s helper

Single requests are limited to 95 MB. For anything larger, use the f2s helper. It is a short Bash script (read it first: https://file2share.us/f2s.sh) that uploads in 50 MB chunks and retries failed chunks, so a dropped connection does not restart the upload. It works on Linux and macOS and needs only curl.

curl -sLo ~/.local/bin/f2s https://file2share.us/f2s.sh && chmod +x ~/.local/bin/f2s
f2s big-video.mp4 another-file.iso

Maximum file size is 50 GB.

A shell shortcut

# add to ~/.bashrc or ~/.zshrc
share() { curl -sT "$1" https://file2share.us; echo; }
share notes.txt

Windows PowerShell

Invoke-RestMethod -Method Put -InFile .\report.pdf -Uri https://file2share.us/report.pdf

Windows 10 and later also ship curl.exe, so curl.exe -T report.pdf https://file2share.us works too.

Share a build from GitHub Actions or GitLab CI

- name: Share build
  run: echo "Download: $(curl -sT dist/app.zip https://file2share.us)" >> $GITHUB_STEP_SUMMARY

Limits

One-command uploadup to 95 MB
With the f2s helperup to 50 GB
Storage time1 to 14 days, then deleted
Rate limit40 uploads per hour per IP address

Uploading malware, stolen data or content you do not have the right to share is not allowed and will be removed. See the terms.

Questions

Do I need an account or API key?

No. Anyone can upload with curl. Uploads are rate limited per IP address to keep the service fast for everyone.

How long are files kept?

Files are deleted automatically after 14 days, or sooner if you send a Max-Days header or use the delete URL.

Can I upload a folder?

Archive it first and upload the archive, for example tar czf - myfolder | curl -T - https://file2share.us/myfolder.tar.gz.

Why is the one-command upload limited to 95 MB?

Requests pass through a CDN that rejects bodies over 100 MB. The f2s helper splits bigger files into 50 MB chunks, so the limit does not apply to it.

Is the link private?

Links contain a random ID and are not listed or indexed, but anyone who has the link can download the file. Encrypt sensitive files before uploading, for example with gpg -c file or age.

Prefer a browser? Upload from the home page by dragging your files in.