-
Notifications
You must be signed in to change notification settings - Fork 266
Closed
Description
PHP version used: 7.1.0
mongo-php-library version: 1.1.0
Hello,
Using this code
/*
Uses MongoDb\GridFS\Bucket::openDownloadStreamByName($filename, array $options = []); to retrieve the file
*/
$file = $gw->retrieveFileByName('3142184dbed342fbb5ad6dc495d02405');
$metadata = stream_get_meta_data($file['stream']);
rewind($file['stream']);
I get a "Warning: rewind(): stream does not support seeking" even though stream_get_meta_data function advertises that the stream is seekable
array (
'timed_out' => false,
'blocked' => true,
'eof' => false,
'wrapper_data' => '(removed for brevity)',
'wrapper_type' => 'user-space',
'stream_type' => 'user-space',
'mode' => 'r',
'unread_bytes' => 0,
'seekable' => true,
'uri' => 'gridfs://mydb/fileStore.files/585bc30888461f001a7a4412',
)
This behavior causes an error in Slim framework which tries to rewind the stream in the Response object if the stream is seekable before sending it out
Metadata
Metadata
Assignees
Labels
No labels