title: Image upload on Phonegap / framework 7 app
body: <p>I'm creating this app with Phonegap and Framework 7.
  In one of my views, i wanted to have a image upload button and i implemented the following code:</p>
  
  <pre><code>&lt;script&gt;
  
  function selectPhoto() {
  
          // Retrieve image file location from specified source
          navigator.camera.getPicture(uploadPhoto,
          function(message) { alert('get picture failed'); },
          { quality: 50, 
          destinationType: navigator.camera.DestinationType.FILE_URI,
          sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY, }
          );
  
      }
  
      function uploadPhoto(imageURI) {
          var options = new FileUploadOptions();
          options.fileKey="file";
          options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
          options.mimeType="image/jpeg";
  
          var params = new Object();
          params.value1 = "test";
          params.value2 = "param";
  
          options.params = params;
  
          var ft = new FileTransfer();
          ft.upload(imageURI, "http://pedrofidalgo.pt/upload.php", win, fail, options);
      }
  
      function win(r) {
          console.log("Code = " + r.responseCode);
          console.log("Response = " + r.response);
          console.log("Sent = " + r.bytesSent);
      }
  
      function fail(error) {
          alert("An error has occurred: Code = " = error.code);
          console.log("upload error source " + error.source);
          console.log("upload error target " + error.target);
      }
  
  &lt;/script&gt;
  
  &lt;button class="btngaleria" onclick="selectPhoto();" style="margin-top:3vh; background-color: #5f919d;"&gt; Upload image &lt;/button&gt;
  </code></pre>
  
  <p>I then have a php file on a web server with this code:</p>
  
  <pre><code>&lt;?php
  print_r($_FILES);
  $new_image_name = $_FILES["file"]["name"];
  move_uploaded_file($_FILES["file"]["tmp_name"], "/uploads/sitios".$new_image_name);
  ?&gt;
  </code></pre>
  
  <p>I tried building the APK and when i click the button it simply doesn't do anything. When i tried the app in the browser, the console says that the function i'm calling with the button (selectPhoto) is not defined.. can someone give some guidance please?</p>