Accessing documents on a device

2 posts, 0 answers
  1. Gerrit
    Gerrit avatar
    33 posts
    Member since:
    Jul 2010

    Posted 07 May 2013 Link to this post

    Hi guys

    Can you please help me out. We want to be able to browse for files, and upload them to our server from the application.
    We have 2 problems now:

    1. We can access files in the photo library, but not files on the memory card, how do we access files that are not stored in the photo library?
    2. We want to save the location of the file, and when the user eventually decides to submit the from, the application should go and find the file in the specific location and get its base64 data and post it to the server. We do not want to save the base64 data because that will make the application very big and duplicate files on the tablet.

    Please help :)

    Here is the code we currently use:

    / Wait for Cordova to connect with the device

        // Cordova is ready to be used!
        function onDeviceReady() {

        // A button will call this function
        function capturePhoto() {
          // Take picture using device camera
, onFail, { quality: 50, saveToPhotoAlbum: true,
            destinationType: destinationType.FILE_URI, 
              sourceType : Camera.PictureSourceType.CAMERA, encodingType: Camera.EncodingType.JPEG });

        // A button will call this function
        function getPhoto(source) {
          // Retrieve image file location from specified source
, onFail, { quality: 50, 
            destinationType: destinationType.DATA_URL,
            sourceType: source });

        // Called when a photo is successfully retrieved
        function onPhotoDataSuccess(imageURL) {
          // Uncomment to view the base64 encoded image data
        // Called when a photo is successfully retrieved
        function onPhotoURISuccess(imageData) {
          // Uncomment to view the image file URI 
        // Called if something bad happens.
        function onFail(message) {
          alert('Failed because: ' + message);
        <button onclick="capturePhoto();">Capture Photo</button> <br>
        <button onclick="getPhoto(pictureSource.SAVEDPHOTOALBUM);">From Photo Library</button><br>
        <img style="display:none;width:60px;height:60px;" id="smallImage" src="" />
        <img style="display:none;" id="largeImage" src="" />

    Kind Regards,
  2. Steve
    Steve avatar
    10941 posts

    Posted 08 May 2013 Link to this post

    Hello Gerrit,

    Take a look at the following forum post (if you haven't) that elaborates on your inquiry.

    All the best,
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
Back to Top