Can I send the file by means of the Curl of the $_FILES array bypassing the save in local storage?

Can I send the file by means of the Curl of the $_FILES array bypassing the save in local storage?
March 12th 20 at 08:00
1 answer
March 12th 20 at 08:02
It is already stored on the server. He has tmpName
Logical! I'm trying to send a file use the boundary (complex query curl):

'Content-Type: multipart/related; boundary=foo_bar_baz',


Next, form an array of the uploaded file:

$postdata = array(
 'name' => '--foo_bar_baz',
 'file' => $file['tmp_name']
);

curl_setopt($this->ch, CURLOPT_POSTFIELDS, $postdata);
- Kurt commented on March 12th 20 at 08:05
@Kurt, to download the file you want to use the @ symbol-for example,
'file' => '@' . $file['tmp_name'] - quentin commented on March 12th 20 at 08:08
@quentin, and how to specify the continuationboundary=foo_bar_baz for file? - Kurt commented on March 12th 20 at 08:11
@Kurt, I don't know what is the requirement of a specific boundary, but that's kind of the gist, where manually generated: https://gist.github.com/maxivak/18fcac476a2f4ea02e... - quentin commented on March 12th 20 at 08:14
@quentin, here you want to send files with these query parameters: https://developers.google.com/drive/api/v3/multipa... - Kurt commented on March 12th 20 at 08:17
@Kurt, https://developers.google.com/api-client-library/p... tried? - quentin commented on March 12th 20 at 08:20
People have long thought of such a thing as Guzzle, and the like, which makes working with http requests in php. If the project is commercial, use reliable and easy to support by tools. - godfrey_Kassulke commented on March 12th 20 at 08:23

Find more questions by tags PHP