0

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.

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. A compressed file with all data would be much more helpful.

danielrvt-sgb
  • 1,118
  • 5
  • 17
  • 33
  • Combine the files, but let the browser handle the gzip part of it for you. Focus on giving yourself a single file to populate the DB with; the server and browser can negotiate the gzip bit (assuming the server is correctly configured). – T.J. Crowder Nov 22 '13 at 16:59
  • possible duplicate of [JavaScript implementation of Gzip](http://stackoverflow.com/questions/294297/javascript-implementation-of-gzip) – Jonathan Hall Aug 21 '15 at 02:58

1 Answers1

0

You can find gz uncompressors for JavaScript in this question: JavaScript implementation of Gzip

Community
  • 1
  • 1
Halcyon
  • 57,230
  • 10
  • 89
  • 128