polyfill icon indicating copy to clipboard operation
polyfill copied to clipboard

PHP 8.1 - CURLStringFile

Open Ayesh opened this issue 4 years ago • 2 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.

Ayesh avatar Feb 16 '21 18:02 Ayesh

This looks like a nice addition to the new PHP 8.1 polyfill. WDYT @nicolas-grekas?

derrabus avatar Feb 16 '21 19:02 derrabus

Yes, this is the perfect place for a polyfill :) PR welcome :)

nicolas-grekas avatar Feb 16 '21 20:02 nicolas-grekas