Skip to content

Instantly share code, notes, and snippets.

@filipsPL
Created April 21, 2020 08:46
Show Gist options
  • Save filipsPL/a5809be967a851bb6fa1e93a65948bbf to your computer and use it in GitHub Desktop.
Save filipsPL/a5809be967a851bb6fa1e93a65948bbf to your computer and use it in GitHub Desktop.
Send form data (with files) using curl

Send form data (with files) using curl

Many recepies for sending data with curl via POST method didn't work for me. Eg, this was not working for me:

🔴

curl -F ‘data=@path/to/local/file’ UPLOAD_ADDRESS

(as advised for example here)

This is one which works for me:

curl -F name=John -F shoesize=11 -F 'file=<file.txt' https://domain.name/form-upload.php

please note the "<" mark in the file form (file=<file.txt)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment