Convert Binary String to Image and store locally
Posted on 2008-06-26
I'm hoping this question is fairly simple but i'm having some trouble with it.
I'm trying to convert a binary string into an image. I'm using a system where you call a web service to request an image and they send it back in binary format. I'm to use this to store the file locally. I"m having trouble storing this locally.
Here is some information about the data being returned:
Content-Type: multipart/parallel; boundary="AABBCCDD"; charset=utf-8
And this is an example of the binary data being returned that i want to store as an image:
--AABBCCDD Content-Type: image/jpeg Content-ID: 1234 Object-ID: 0 ýýýýJFIF``ýýC $.' ",#(7),01444'9=82<.342ýýC 2!! ... --AABBCCDD--
I know this data has boundaries set so i need to grab what's in between and store the image locally. I'm hoping this can be done in PHP.
If more information is needed please let me know.
Any and all help is much appreciated.
Thanks in advance.