Estoy intentando (PHP) cURL PONER un archivo de Amazon S3 a Vimeo usando el contenedor de flujo S3 (s3://...) y obtengo el siguiente error:
curl_setopt_array(): no puede representar un flujo de tipo tcp_socket/ssl como un ARCHIVO STDIO en [...]
¿Hay alguna manera de cURL PUT un archivo remoto? Estas son las opciones de curl que se envían:
$curl_opts = array( CURLOPT_PUT => true, CURLOPT_INFILE => $file, // this refers to 's3://path-to-object' CURLOPT_INFILESIZE => $size, CURLOPT_UPLOAD => true, CURLOPT_HTTPHEADER => array('Expect: ', 'Content-Range: replaced...') );Guarde el archivo en su servidor local antes de PONERLO:
$file = tempnam(sys_get_temp_dir(), "foo"); $data = file_get_contents("s3://path-to-object"); $size = strlen($data); file_put_contents($file, $data); $curl_opts = array( CURLOPT_PUT => true, CURLOPT_INFILE => $file, // this refers to 's3://path-to-object' CURLOPT_INFILESIZE => $size, CURLOPT_UPLOAD => true, CURLOPT_HTTPHEADER => array('Expect: ', 'Content-Range: replaced...') );