To upload a file using the command line, do the following:
Code
curl "
http://example.com/upload.php" -F myfile=@"/path/to/file"
Example:
Code
curl "
http://example.com/upload.php" -F myfile=@"~/Desktop/image.png"
And using authentication:
Code
curl -u username:password "
http://example.com/upload.php" -F myfile=@"~/Desktop/image.png"
NOTE: Change myfile to the file input value name. <input name="myfile" type="file" />
PHP
// upload.php
var_dump($_POST);
var_dump($_FILES);