How to view and select a file from an SD card using Phonegap 3.0?

Passed through Phonegap 3.0 API.

I want to view files from an SD card when I click a link or button using the user interface

For instance:

<p onclick="browseFile()">Upload</p> 

Suppose the browseFile () function contains a view, but requires a user interface.

or

  <input type="file"> 

But when I use input type = file, it looks at the file from gallery and music tracks, but not from the SD card.

I want so that I can select a file from SD using the user interface when I click the link or button

Can someone suggest a link for the same one that gives the Java Script code along with the user interface for viewing the file from the SD card?

+4
source share
2 answers

There is no ready-made solution. Unfortunately, you have to create it yourself using the File API .

Here you have an example using jQuery Mobile.

+5
source

I did not find a ready-made solution there in the wild, and I needed one for my project, so I wrote this simple library called FileSelect . It has a WTFPL license, so you can use it for any purpose.

+1
source

Source: https://habr.com/ru/post/1498333/


All Articles