Current Article:

How to use cURL to upload POST data with files?

How to use cURL to upload POST data with files?

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/user/test.jpg" \
  localhost/upload.php