Re: Re: Send files in CURL from string
| From: | Alexander Moskalev | Date: | Tue, 21 Jun 2016 21:28:20 +0000 |
| Subject: | Re: Re: Send files in CURL from string | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94184@lists.php.net to get a copy of this message | ||
Thank you!
2016-06-21 23:31 GMT+03:00 Davey Shafik <davey@php.net>:
> you can use a memory stream
I thought about something like that. But if we created memory stream
(php://memory ?), we have file pointer resource related to this stream. And
we cannot read or write something in this stream without such file pointer
provided.
Example code:
>
> $fp = fopen("php://memory", 'r+');
> fputs($fp, "foo\n");
> rewind($fp);
> echo file_get_contents("php://memory"); // <- this doesn't work, and same
> will be in curl.
> echo stream_get_contents($fp); //<- this will work
Or you mean something else?
--
With regards, Alexander Moskalev
irker@irker.net
irker@php.net
a.moskalev@corp.badoo.com