I am working with our Java team to pass a string of data from a Java client app to my PHP page. We were doing this in XML and everything worked great, but now they are sending me ZIP datastream. All functions I've found for reading ZIP files in PHP require a file, which I don't have. I take the ZIP datastream sent to me and throw it in a variable. How do I read this? Is it even possible? I've already tried creating a ZIP file on the fly using fopen and the extension ".zip" and stuffing the ZIP data into it but it doesn't work, says it is an invalid archive. And I cannot create a real ZIP file on the fly because the data I'm receiving is already zipped.
Here is the code I use to accept the datastream:
Code: Select all
$HTTP_RAW_POST_DATA = file_get_contents("php://input");
how can I unzip the $HTTP_RAW_POST_DATA var?