how to uncompress zip archive from string?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vitalik_dj
Forum Newbie
Posts: 1
Joined: Mon Sep 04, 2006 2:45 am

how to uncompress zip archive from string?

Post by vitalik_dj »

Some web service return me ansver in zip archive.
This zip archive is in string variable.
If i write this variable to file, I was able to unzip this file using functions from the ZZIPlib library (zip_open,zip_read, zip_entry_read).

But question is how to unzip contents of zip archive directly from string variable without writing additional files?
all functions, which i found, to unzip archive works only with files, not with string variable :(

can anybody help me with this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

gzinflate() may be of interest, but the data may not be in a format it understands, so there's also this, which while it is intended to work on files I don't see why it couldn't be adjusted to work on a string.
Post Reply