ngCordovaの$ cordovaCaptureサービスからUploadCareにサウンドファイルをアップロードしようとしています。 uploadcare.fileFrom( 'object')は、アップロードエラーで失敗し続けます。私は公開鍵を持っています。私はそれを送信し、タグをつけて、document.getElementById( 'fileTag')。files [0]にアクセスしてファイルをアップロードすることができます。uploadcareファイルからngCordova MediaFile
$cordovaCapture.captureAudio()
.then(function (audioData) {
return uploadcare.fileFrom('object', audioData[0])
.done(function (fileInfo) {
console.log(fileInfo);
}).fail(function (err) {
console.log(err);
})
})
オーディオデータが[0]オブジェクトがこの
MediaFile {
end:0
fullPath:"file:/storage/emulated/0/Sounds/Voice%20002.m4a"
lastModified:null
lastModifiedDate:1481324751000
localURL:"cdvfile://localhost/sdcard/Sounds/Voice%20002.m4a"
name:"Voice 002.m4a"
size:49227
start:0
type:"audio/mpeg"
} __proto__:File
のように見える、私は問題は、オブジェクトがMediaFileがなく、ファイルであることかもしれないと思ったが、私は、他の1つをキャストいくつかの助けを使用することができます。 window.resolveLocalFileSystemUrlを使用して
FileEntry
filesystem:FileSystem
fullPath:"/Sounds/Voice 002.m4a"
isDirectory:false
isFile:true
name:"Voice 002.m4a"
nativeURL:"file:///storage/emulated/0/Sounds/Voice%20002.m4a"
__proto__:Entry
File
end:49227
lastModified:1481324751000
lastModifiedDate:1481324751000
localURL:"cdvfile://localhost/sdcard/Sounds/Voice%20002.m4a"
name:"Voice 002.m4a"
size:49227
start:0
type:"audio/mpeg"
__proto__:Object
()あなたは上記のファイルにオブジェクトを与えるが、それでも「アップロード」エラーで失敗しuploadcare上記ファイルエントリオブジェクトで終わります。