Memory streams
| From: | Adrian Drumea | Date: | Fri, 13 Jul 2007 13:02:40 +0000 |
| Subject: | Memory streams | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-30890@lists.php.net to get a copy of this message | ||
Hello,
I'm new to this list, so I aplogize if this is not the place to
post this message.
I was using today the getimagesize() function which takes a file
name. I was trying to take the size of an image decoded using
base64_decode from a string. So I have my decoded data in $data.
Now to apply getimagesize() I need a file, so I saved $data to
a temporary file and everything worked. I then tried to avoid
the temporary file by using i/o streams, but I didn't manage to
do this.
Correct me if I am wrong, but from what I see there is no way
to create a memory stream using php://memory and also attach
a unique key to it. If that would be possible, I could create
a memory stream with a unique key, write the data into it and
then pass this memory stream name to the getimagesize() function.
In this way, all functions requiring a file could be used on
a memory buffer.
Adrian Drumea