From e727919b97c4baeca93cb7700d4adf2e35a3530f Mon Sep 17 00:00:00 2001 From: Alexander Moskalev Date: Thu, 26 Nov 2020 10:30:02 +0300 Subject: cURL: make possible to send file from buffer string Add CURLStringFile class which works similarly to CURLFile, but uploads a file from a string rather than a file. This avoids the need to create a temporary file, or use of a data:// stream. Basic usage: $file = new CURLStringFile($data, 'filename.txt', 'text/plain'); curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]); Closes GH-6456. --- UPGRADING | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'UPGRADING') diff --git a/UPGRADING b/UPGRADING index 2e4700c1c9..5d72233e90 100644 --- a/UPGRADING +++ b/UPGRADING @@ -100,6 +100,11 @@ PHP 8.1 UPGRADE NOTES - Curl: . Added CURLOPT_DOH_URL option. + . Added CURLStringFile, which can be used to post a file from a string rather + than a file: + + $file = new CURLStringFile($data, 'filename.txt', 'text/plain'); + curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]); - hash: . The following functions have changed signatures: -- cgit v1.2.1