Filepicker plugin, how to store selected file to Sqlite db and retrieve file?


#1

Hi,
I have used the nativescript-file-picker plugin.
Plugin - " http://plugins.nativescript.org/plugin/nativescript-file-picker "

In that case i can able to get the selected file path like,

JS: selected file
JS: --------------------------------------------------
JS: file:///storage/emulated/0/config.txt
JS: --------------------------------------------------

In my case i need to handle lot of file attachment with my app. So please suggest me with suitable way?
Now my questions are,

  1. Here i need to store selected file path only to sqlite ? If it is fine means how shall i store path to sqlite?
  2. Otherwise, How to store the selected file directly to sqlite db?

Thank you for reading, looking forward to reading your responses!


#2

Hey @kumaran!

Have you selected a plugin to handle the sqlite operations? Have you read through the plugin’s documentation on how to work with it? What have you tried so far?


#3

@Pete.K So far i have tried with filepicker plugin only. Now i can able to get the path of selected file. Hereafter i need to save this selected file into the sqlite db.

This is what i am trying to do…

From where i will get the documentation about insert the selected file into Sqlite db as well as retrieve?


#4

Well, so there should be code, if you’ve tried? nativescript-sqlite is a popular choice among the community. Look it up, and read the README if there’s one. They normally contain enough information to get you started on using the plugin. Working with SQLite requires basic SQL knowledge, nothing you can’t Google of course.