Compression:zip

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Compression:zip

Lin Ni

Hello guys,


I need a function for compressing files in my application and found

compression:zip($sources as xs:anyType+$use-collection-hierarchy as xs:boolean
as xs:base64Binary*

I tried many times. I always got an error.

exerr:ERROR Unable to encode string value: The underlying InputStream has been closed

I also tried the method mentioned here:

https://sourceforge.net/p/exist/mailman/message/30245041/

But it didn't work. Even the simple function

compression:zip((<entry name="test.png" type="uri">/db/test.png</entry>),true()) didn't work.

I'd appreciate any tips about how to prevent the error.

Best,

Lin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compression:zip

Adam Retter
> But it didn't work. Even the simple function
>
> compression:zip((<entry name="test.png"
> type="uri">/db/test.png</entry>),true()) didn't work.
>
> I'd appreciate any tips about how to prevent the error.


If you want to pull in XML or Binary files from the database you
should use either something like:

compression:zip((<entry name="test.png"
type="binary">{util:binary-doc("/db/test.png")}</entry>),true())

The URI approach is designed for accessing resources over http.





--
Adam Retter

eXist Developer
{ United Kingdom }
[hidden email]
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Compression:zip

Lin Ni
Hello Adam,

thank you very much for your tips. It works well.


Regards,

Lin

Am 13.04.2017 um 16:37 schrieb Adam Retter:

>> But it didn't work. Even the simple function
>>
>> compression:zip((<entry name="test.png"
>> type="uri">/db/test.png</entry>),true()) didn't work.
>>
>> I'd appreciate any tips about how to prevent the error.
>
> If you want to pull in XML or Binary files from the database you
> should use either something like:
>
> compression:zip((<entry name="test.png"
> type="binary">{util:binary-doc("/db/test.png")}</entry>),true())
>
> The URI approach is designed for accessing resources over http.
>
>
>
>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...