You need to use the -F
option:
-F/--form <name=content> Specify HTTP multipart POST data (H)
Try this:
curl \
-F "userid=1" \
-F "filecomment=This is an image file" \
-F "image=@/home/user1/Desktop/test.jpg" \
localhost/uploader.php
More Related Contents:
- POST a file string using cURL in PHP?
- Curl to return http status code along with the response
- How to check if an URL exists with the shell and probably curl?
- jQuery Ajax File Upload
- Check if a file exists with a wildcard in a shell script [duplicate]
- Send file using POST from a Python script
- How can I check if a command exists in a shell script? [duplicate]
- Reading uploaded text file contents in html
- Test if remote TCP port is open from a shell script
- How to invoke bash, run commands inside the new shell, and then give control back to user?
- How/When does Execute Shell mark a build as failure in Jenkins?
- Using find to locate files that match one of multiple patterns
- How to send file contents as body entity using cURL
- Need bash shell script for reading name value pairs from a file
- ‘\r’: command not found [duplicate]
- How can I check the version of sed in OS X?
- Can I ssh somewhere, run some commands, and then leave myself a prompt?
- How to kill all processes matching a name?
- in mac always getting zsh: command not found: [closed]
- Ansible Command module says that ‘|’ is illegal character
- Is there a “standard” format for command line/shell help text?
- Write byte at address (hexedit/modify binary from the command line)
- sh read command eats backslashes in input?
- Redirecting/storing output of shell into GDB variable?
- Which terminal command to get just IP address and nothing else?
- How to add text at the end of each line in unix
- Uploading file to HTTP via Powershell
- How to print 5 consecutive lines after a pattern in file using awk [duplicate]
- how do I use the grep –include option for multiple file types?
- Batch convert latin-1 files to utf-8 using iconv