Is it possible to use cURL to stream upload a file using POST?

curl, php

Solution

cURL has already support for streams, try `curl --help | grep binary` and you will get:

--data-binary DATA HTTP POST binary data (H)

An example:

curl -v -XPOST http://example:port/path --data-binary @file.tar -H "Content-Type: application/octet-stream"

Problem

Or does PHP not allow this? I have read it is possible using PUT but the server is expecting POST only.

Original source

Related problems