title: Phonegap/Cordova ... delete temporary filesystem after taking a picture
body: <p>I've discovered that my Phonegap/Cordova app on iOS is saving all the pictures I take with the camera and uploading them to a server.</p>
  
  <p>In iPhone settings under the "use" tap there is my app and the disk size it needs is increasing, even after quitting the app.</p>
  
  <p>So how could I delete these temporary files, or the picture itself, after it was uploaded to my server? I use the pictureURI to locate it for uploading.</p>
  
  <p><strong>EDIT:</strong> thanks. I've implemented the code and now it looks like this:</p>
  
  <p>In my fileupload function I've added this line:</p>
  
  <pre><code>window.resolveLocalFileSystemURI(fileURI, onResolveSuccess, faillocal);
  </code></pre>
  
  <p>and the other functions look like:</p>
  
  <pre><code>function onResolveSuccess(fileEntry) {
    console.log(fileEntry.name);
    entry.remove(entrysuccess, failresolve);
  }
  
  function entrysuccess(entry) {
    console.log("Removal succeeded");
  }
  
  function failresolve(error) {
    alert('Error removing directory: ' + error.code);
  }
  
  function faillocal(evt) {
    console.log(evt.target.error.code);
  }
  </code></pre>
  
  <p>But it doesn't work. File is uploaded, but no alert, no console writing, no deleting at all...</p>