How to compress data on asp.net and uncompress in javascript

倖福魔咒の 提交于 2019-12-23 02:48:19

问题


Hi this is my first Question :)

I need a lib or way to compress a data in asp.net (vb) with the algorit deflate but the result inflate in javascript.

I'm use a lib in javascript: deflate.js hxxp://www.codeproject.com/KB/scripting/Javascript_binaryenc.aspx?msg=2904739

First i'm deflate and convert to base64 the result but the result is no compatible with the javascript lib.

i'm use the Chilkat .NET DLL hxxp://www.example-code.com/vbdotnet/deflate_string.asp

The String result with this lib is compatible with the javascript libray but is not free.

I need a way to compress data in asp.net and uncompress in javascript. This is for my web aplication need to download many many data.

P.D.: Sorry for my english :)


回答1:


Instead of programming your custom solution, couldn't you simply enable HTTP compression on your web server? That way, compression/decompression would be automatically handled by the webserver and browser and your data is sent gzipped over the wire.




回答2:


Update of my post here is at: http://pastie.org/1588170

-+-+-+-+-+-+-+-+-+-+

I use DEFLATE encoder and decoder implementation in Javascript at http://github.com/dankogai/js-deflate

I use Google's V8 Javascript engine ( url ) on server side to run Javascript code which I run on client side in web browser.



来源:https://stackoverflow.com/questions/2349210/how-to-compress-data-on-asp-net-and-uncompress-in-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!