Streaming a retrieved file

Hello there !

I have a PHP SF5 application that uses Couchbase to store PDF documents. Actually, in order to download them, we fetch them from couchbase (which implies loading them in memory, PHP side), then upload them to the client.

For optimization purpose (the documents can be quite big and we may have some traffic to handle), I would like to stream them (using Guzzle, for instance). Issue being, as soon as I do $bucket->get($key), I get a Couchbase\Document object and its value is some string : basically it’s already loaded in PHP memory.

Is there any way to actually get a stream in order to not overload my memory ?

Regards,

Hello,

Is that even possible ?

Regards