Option to upload a file- as it is possible to upload a photo

Posted by Shira Taytelbaom on 25-Oct-2016 05:47

When I call the function getPhotoLibrary:

getPhotoLibrary: function (e) {
                navigator.camera.getPicture(
                 uploadPhoto,
                 function (message) {
                     alert("Failed to get a picture. Please select one.");
                 }, {
                     quality: 20,
                     destinationType: navigator.camera.DestinationType.FILE_URI,
                     sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
                 });
            },

The gallery of the photos in my phone is opened and I can choose a photo.

I want to be able to see also the files in my phone- and to be able to choose a file!

How can I do it?

Thanks a lot!

Shira

All Replies

Posted by egarcia on 25-Oct-2016 07:19

Hello Shira,

Here is a suggestion.

The HTML5 File, FileReader and FileList APIs seem to be supported on most web browsers and as such web containers.

See the following links for info and examples:

caniuse.com/

www.html5rocks.com/.../

demos.telerik.com/.../index

These API seem to work fine from a web browser. I have not tried them from a mobile app.

There may be a Cordova FileTransfer API and or a plug-in but perhaps the HTML5 support is sufficient.

I hope this helps.

Edsel

Posted by Ruben Dröge on 25-Oct-2016 08:16

I think you should take a look here:

github.com/.../cordova-plugin-file

and here:

cordova.apache.org/.../index.html

Posted by Shira Taytelbaom on 26-Oct-2016 02:50

I looked and tried to use this demo: demos.telerik.com/.../index

I got the option of uploading a file too, and not just a photo,

But Now if I want to save that file in rollbase,

How do I do it?

Thanks a lot!!

This thread is closed