Re: unzip openDocument in safe mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bernhard Zwischenbrugger wrote:
> I try to unzip openDocument files with pclzip.
> At my laptop this is no big problem, but the target server has "safe
> mode" switched on (no way to change that).
> 
> The problem with safe mode and unzipping openDocument ist, that a
> openDocument zip file contains directories. It is not possible to write
> to directory owned by webserver uid (because of safe mode)

are there no world writable directories available anywhere for you to use?

> 
> My Project:
> I try to extract the "content.xml" from openDocument, change it and
> store it back to the openDocument (zip) file.
> 
> Question:
> Is it possible to extract a single file from a zip file?
> Is it possible to replace a single file in a zip file?

it kind of depends on your particular setup (server version, access to
PECL, etc):

there is this (will require some reading to determine if you can
use it in your case):

	http://php.net/zip

and then there is the possibility of using exec() in conjunction with
the cmdline zip utility, e.g.:

	$args = escapeshellarg($theRequiredArgsToZipCmd);
	exec("zip -options $args");

here is a webpage version of the zip man page (in case you dont
have shell access):

	http://www.die.net/doc/linux/man/man1/zip.1.html

other than that all I can thing of is this (it might turn up something usable):

	http://www.google.com/search?q=php+zip+file+class

> 
> I need something  like:
> 
> $contentString=extractFromZip("xy.zip","content.xml")
> ... $contentString will be changed ...
> replaceFileInZip("xy.zip","content.xml",$contentString);
> 
> 
> thanks
> 
> Bernhard
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux