cordova: upload image not working after taking picture

后端 未结 2 1266
醉话见心
醉话见心 2021-01-28 11:51

Iam working on a iOS App developed with Apache Cordova aka Phonegap. I\'d like to upload photos in two steps: 1. Capture the photo and show the photo in small size 2. Upload the

2条回答
  •  情歌与酒
    2021-01-28 12:08

    1. Capture the photo and show the photo in small size

    • Here you can set image on success onCapturePhoto(fileURI) e.g.

        
      
      function onCapturePhoto(fileURI) {
        $("#cameraPic").attr("src", fileURI);
      }
      

    2. Upload the photo for taking the picture one button to upload

        
    
        function photoUpload() {
            var fileURI = $("#cameraPic").attr("src");
    
            /* YOUR CODE TO UPLOAD IMAGE*/
        }
    

提交回复
热议问题