Skip to content

feat: autodetect zip with .bin extension #683

@patrick-99

Description

@patrick-99

Hi,

The problem:
I use Capacitor/SQLite in the contexte of an Ionic application.
This app makes HTTPS requests to a Convertigo REST API to get .zip or .db files.
Convertigo is designed to get binary files with URL ending with .bin extension only, but the SQLite plugin only supports .zip and .db extension when using "GetFromHTTPRequest" to init a database with remote content.

New expected behaviour:
I would like implementation of "GetFromHTTPRequest" to check the extension of the provided URL, and in case it is '.bin' download the file and check first 4 bytes to determine it is zip or not.
Therefore The Convertigo will accept URL extension, and SQLite plugin will unzip or not the received file whether it is detected as zip content or not.

Alternative:
Convertigo server can implement a URL mapping to change extension from .zip to .bin, thus allowing to get files without any change in the Capacitor plugin. Nevertheless, this configuration shall be avoided, and Capacitor would benefit from the autodetect new feature.

The existing pull request:
I already implemented the solution this forked repository:
https://github.com/patrick-99/sqlite/tree/feat/convertigo-support

I also made the same changes to support .bin extension in the Jeep plugin:
https://github.com/patrick-99/jeep-sqlite/tree/feat/convertigo-support

cheers,
Patrick.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions