I want to use a php proxy to resolve the cross domain problem during uploading file. In the script i used php curl to forward request and response, but i don't know how to forward the request body to the server when the request body is multipart/format-data. file_get_contents('php://input') will be null when the Content-Type header is "multipart/form-data". And when using curl_setopt( $ch, CURLOPT_POSTFIELDS, $_POST), the Content-Disposition in request body could be sent, while the real data of file could not.
My request body is like this:
------WebKitFormBoundaryd0tvwIvevPV4VTlP
Content-Disposition: form-data; name="name"
nbzdds.mp3
------WebKitFormBoundaryd0tvwIvevPV4VTlP
Content-Disposition: form-data; name="chunk"
15
------WebKitFormBoundaryd0tvwIvevPV4VTlP
Content-Disposition: form-data; name="chunks"
44
497161
------WebKitFormBoundaryd0tvwIvevPV4VTlP
Content-Disposition: form-data; name="file"; filename="blob"
Content-Type: application/octet-stream
��v\;"S�;-�mG\u#...
.
.
.