curl -F 'file=@photo.jpg' https://upload.example.com

Category: Web App Development

curl -F 'file=@photo.jpg' https://upload.example.com

Upload a file as multipart form data

Posts photo.jpg as a multipart/form-data upload, the same encoding browsers use for file inputs. The @ prefix tells curl to read the file from disk. Add more -F flags for extra fields, like -F 'caption=holiday'.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.