简体   繁体   English

使用javascript下载并解压缩gz文件[ClientSide]

[英]Download and extract gz file using javascript [ClientSide]

I'd like to download a database compressed as a .gz file in a cordova application and extract it to create a local WEBSQL database. 我想在cordova应用程序中下载一个压缩为.gz文件的数据库,并将其解压缩以创建本地WEBSQL数据库。

Is this posible? 这可能吗?

I have the need to do this because my app needs to work offline, besides that this database I have to sync is so big that is unthinkable to download it uncompressed. 我需要执行此操作,因为我的应用程序需要脱机工作,此外,我必须同步的数据库很大,以至于无法以未压缩的方式下载它都是不可想象的。

This sync only happens one time in my app. 此同步仅在我的应用中发生一次。 So after that is not a big deal. 所以在那之后没什么大不了的。

Thanks in advance! 提前致谢!

PD : I'm currently downloading each table separately but it takes too long, the code is a mess with all the callbacks and stuff. PD :我目前正在分别下载每个表,但是花费的时间太长了,代码与所有回调和内容一团糟。 A compressed file with all data would be much more helpful. 包含所有数据的压缩文件将更有帮助。

您可以在以下问题中找到JavaScript的gz解压缩器: Gzip的JavaScript实现

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM