Reputation: 4079
I have an xml file around 30 MB, which is distributed to client as Gzip Xml File through URL, but the problem is that as a Client, I can't save a copy of it into the client's server, as xml file.
When I try with SimpleXMLElement
, it says that I have a problem on:
Request must contains the Accept-Encoding: gzip, deflate header
Upvotes: 3
Views: 1174
Reputation: 639
You can tell PHP directly to uncompress from that URL so that you do not need to change headers in the HTTP stream wrapper context options:
$xml = simplexml_load_file("compress.zlib://http://site.com");
Upvotes: 3