Cordova - How to POST (upload to server) image picked with ImagePicker?
<p>I use Cordova ImagePicker plugin to pick image from the phone gallery. It returns the image file URI. How do I send that image to server based on its URI path? </p>

<pre><code>pickImage() {
    ImagePicker.getPictures({maximumImagesCount: 1}).then(
        results =&gt; {
            results.map(file_uri =&gt; {
                console.log('GOT FILE URI: ' + file_uri);
                // SEND FILE TO SERVER
            });
        }, err =&gt; {
        }
    );
}
</code></pre>

<p>Tried but failed:</p>

<ul>
<li><strong>FileTransfer</strong> plugin. It is supposed to upload the image to an endpoint based on the local URI path. But it didn't work for me and fails in silence.</li>
<li><strong>File</strong> plugin. It is supposed to be able to read the local file and return the binary, which I can then POST to server. But it doesn't read the file and fails in silence for me.</li>
</ul>