From: Jonathan Mills on
Is it possible to create a ZipArchive to a non-file storage, eg string?

I want to create a small zip of some data, and then load it into a database.

I don't need the intermediate file.

I tried various filters, and I can READ a zip archive with the
"data://" wrapper, but haven't found any way of creating the data
other than in a file yet.

Jonathan
From: Viacheslav Chumushuk on
Hello.
As I understand you in a right way you need next function http://ua.php.net/manual/en/function.gzcompress.php

On Wed, Sep 22, 2010 at 10:16:30AM +0100, Jonathan Mills <Jonathan.N.Mills(a)gmail.com> wrote:
> Is it possible to create a ZipArchive to a non-file storage, eg string?
>
> I want to create a small zip of some data, and then load it into a database.
>
> I don't need the intermediate file.
>
> I tried various filters, and I can READ a zip archive with the
> "data://" wrapper, but haven't found any way of creating the data
> other than in a file yet.
>
> Jonathan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--
Best regards, Viacheslav Chumushuk
email/jabber: voice(a)root.ua
Ukraine, Khmelnitsky
- - - - -
Please, use plain text message format contacting me, and
don't use proprietary formats for attachments (such as DOC, XLS)
use PDF, TXT, ODT, HTML instead. Thanks.
From: Jonathan Mills on
On 22/09/2010 12:11, Viacheslav Chumushuk wrote:
> Hello.
> As I understand you in a right way you need next function http://ua.php.net/manual/en/function.gzcompress.php

Thanks for the suggestion Viacheslav , but I'd trying to
the create the complete zipfile structure, gzcompress() just
compresses the file's data (and in a slightly different manner
to what ZIP does - the first and last 4 bytes are different to
what zip produces) and, probably more importantly, doesn't
add the file name headers on either end

But the principle - ie something that returns a "string" -
is what I'm looking for.

Kind Regards
Jonathan

From: Carlos Medina on
Am 22.09.2010 17:32, schrieb Jonathan Mills:
> On 22/09/2010 12:11, Viacheslav Chumushuk wrote:
>> Hello.
>> As I understand you in a right way you need next function http://ua.php.net/manual/en/function.gzcompress.php
>
> Thanks for the suggestion Viacheslav , but I'd trying to
> the create the complete zipfile structure, gzcompress() just
> compresses the file's data (and in a slightly different manner
> to what ZIP does - the first and last 4 bytes are different to
> what zip produces) and, probably more importantly, doesn't
> add the file name headers on either end
>
> But the principle - ie something that returns a "string" -
> is what I'm looking for.
>
> Kind Regards
> Jonathan
>
Hi Jonathan,
and what if you serialize your String? You can save Objects in it...

Regards

Carlos
From: Jonathan Mills on

> and what if you serialize your String? You can save Objects in it...

True, but the defined format for the item in the database is a zip file
(it gets exported later to another, external, application which eats zip
files) :-(
 |  Next  |  Last
Pages: 1 2
Prev: Database Administration
Next: Copying an Object