PHP 8.1 - CURLStringFile
Ayesh opened this issue · comments
PHP 8.1 adds a new CURLStringFile
, that makes it possible to upload a file directly from a variable. With existing CURLFile
, it is required to specify a path or a URI (that allows data://
fortunately).
There is a polyfill that I created and tested manually. It works by encoding the passed data into a data://
URI within the constructor, and setting them into properties of a CURLFile
subclass.
I would like to ask if a CURLStringFile
polyfill would fit Symfony Polyfill project. If it does, I'd happily send a PR :)
Thank you.
This looks like a nice addition to the new PHP 8.1 polyfill. WDYT @nicolas-grekas?
Yes, this is the perfect place for a polyfill :)
PR welcome :)