Cheatsheet Pages / curl Cheatsheet

How to upload a file with curl — -F multipart form

The endpoint expects a multipart/form-data upload, like a browser file form.

curl -F "avatar=@me.png" -F "bio=hello world" https://example.com/upload
# add ;type=image/png after the filename to set the MIME type explicitly

Good to know

@ reads the file from disk; add ;type=image/png after the filename to set the MIME type explicitly.

curl Cheatsheet one-page card — commands that actually work
The full one-page card — curl Cheatsheet. Get the complete cheatsheet on GitHub