I want to connect to a file on my ftp server. I can download the db file by wget:
wget ftp://hello:world@192.168.137.181:21/test.db
my is as follows:
#include <stdio.h>
#include <stdlib.h>
#include "sqlite3.h"
int main(int argc, char* argv[])
{
sqlite3 *db;
char *zErrMsg = 0;
int rc;
char *sql;
sqlite3_config(SQLITE_CONFIG_URI,1);
/* Open database */
rc = sqlite3_open_v2("ftp://hello:world@192.168.137.181:21/test.db", &db, SQLITE_OPEN_READONLY | SQLITE_OPEN_URI , NULL);
if( rc ){
fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
exit(0);
}else{
fprintf(stdout, "Opened database successfully\n");
}
but it showed the error: Can't open database: unable to open database file
if I change ftp URI to a local db file path,it will work perfectly fine. so how can I solve this problem?