Hello fellow Ioners,
I was wondering if someone could help me how to approach this.
I’m capturing a video with cordova media-capture plugin, and I wish to transmit it with other data via a ‘FormData’ object as multipart form.
But the media-capture plugin exports this information:
“Video Recorded. Result:
[{“name”:“20160710_195724.mp4”,“localURL”:“cdvfile://localhost/sdcard/DCIM/Camera/20160710_195724.mp4”,“type”:“video/mp4”,“lastModified”:null,“lastModifiedDate”:1468195046000,“size”:2731528,“start”:0,“end”:0,“fullPath”:“file:/storage/emulated/0/DCIM/Camera/20160710_195724.mp4”}]”,
I need to transfer the file into FormData object, but FormData requires a ‘File’ object.
How do I approach turning a file from its path to ‘File’ object? The element does not seem to be able to accept a path programmatically so I can retrieve the ‘File’ object.
I’m looking into cordova-file-plugin, but have did not made it to work yet.
Am I on the right track, or there is a simpler approach to do it?
Thank you in advance
Costas