Making file upload feature for your PhoneGap app

Making file upload feature for your PhoneGap app

In my previous post, I have given very high level concept of adding this feature to the app. In this post, I will walk you through techincal way of doing this.

To add this feature, we need to add two plugins to our project(cordova/phongap) that access device's camera and file system. These are mentioned below:

  1. Camera : - The camera object provides access to the device's default camera application.

  2. File :- An API to read, write and navigate file system hierarchies, based on the w3c file api.

Go through the documentations to find out appropriate methods for your scenario. In this demo, Camera clicks a new picture or picks any file from gallery and then file is read by File plugin giving its metadata information(like base64Encoded body, MIME Type, Size etc...).

Below are the videos recorded on actual devices:


You can find full working code here

Hope this helps!

If anyone need my help on this, contact me here or send me an email directly.

Related Posts:
Adding file upload feature in your phoneGap application.

Getting issues in reading videos' url in IOS + PhoneGap App.

Lakshay Katney Avatar

Lakshay Katney

Saleforce developer by profession but I like to work with various technologies.I blog about Force.com, Hybrid Apps, PhoneGap, AngularJS, BackboneJS, JavaScript in general. I am Angular & NodeJS fan.

Read More
Share this page
Latest 15 Posts

100%