I have a module which posts a request to an external site and gets a response which is gzipped. Does anyone know how i can unzip it easily?

I have tried writing the data to a file, which i can do. I cannot however fathom out how to decompress the file from a drupal module. I know that this works

gunzip -d /var/www/vhosts/livelinknewmedia.com/httpdocs/sites/costcutter.livelinknewmedia.com/files/nisa/response.rar

from the command line. I wonder if it is possible to execute this from dupal. I have tried

$execute = exec('gunzip -d /var/www/vhosts/livelinknewmedia.com/httpdocs/sites/costcutter.livelinknewmedia.com/files/nisa/response.rar');

but nothing seems to happen (i think it maybe a permissions issue?)

Or is there a BETTER WAY?

Comments