【cordova】cordovaFileTransfer で params も付けてファイルアップロード
ngCordovaの$cordovaFileTransferの使い方メモ
https://github.com/apache/cordova-plugin-file-transfer のラッパー
$cordovaFileTransfer.upload(
'https://xxx.yyy.zzz/path/to/api'
'path/to/upload_file', {
fileKey: 'image', // アップロードするファイル名
httpMethod: 'POST',
headers: { // 任意のHTTPヘッダー
header1: 'xxxxxx',
header2: 'xxxxxx'
}
params: { // 任意のパラメータ
param1: 'xxxxx',
param2: 'xxxxx',
}
}
).then(function() {
// success
}).catch(function(err) {
// failed
})以上です