diff options
author | Alexander Moskalev <irker@irker.net> | 2020-11-26 10:30:02 +0300 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-02-16 10:24:22 +0100 |
commit | e727919b97c4baeca93cb7700d4adf2e35a3530f (patch) | |
tree | 81ef04e6048481ad94c22a4316c7346d2484380e /ext/curl/php_curl.h | |
parent | d16341dabe30f03149d78a03dad734b9d32907b2 (diff) | |
download | php-git-e727919b97c4baeca93cb7700d4adf2e35a3530f.tar.gz |
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.
Diffstat (limited to 'ext/curl/php_curl.h')
-rw-r--r-- | ext/curl/php_curl.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 88806262ec..09e20602f4 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -39,5 +39,6 @@ PHP_CURL_API extern zend_class_entry *curl_ce; PHP_CURL_API extern zend_class_entry *curl_share_ce; PHP_CURL_API extern zend_class_entry *curl_multi_ce; PHP_CURL_API extern zend_class_entry *curl_CURLFile_class; +PHP_CURL_API extern zend_class_entry *curl_CURLStringFile_class; #endif /* _PHP_CURL_H */ |