0
が、これは私のアップロードファイル機能である:イオン2ファイルのアップロード
uploadresume()
{
this.fileChooser.open()
.then(uri =>
{
console.log(uri)
const fileTransfer: TransferObject = this.transfer.create();
let options1: FileUploadOptions = {
fileKey: 'file',
fileName: 'name.pdf',
params: {resume:uri},
chunkedMode : false,
headers: { Authorization:localStorage.getItem('token') }
}
console.log (localStorage.getItem('token'))
fileTransfer.upload(uri, "http://website.com/upload", options1)
.then((data) => {
// success
alert("success"+JSON.stringify(data));
}, (err) => {
// error
alert("error"+JSON.stringify(err));
});
})
.catch(e => console.log(e));
}
今私のAPIエンドポイントは、それに添付ファイルでパラメータの再開になります。しかし、私は500エラーを取得し続けます。私はそれがエンドポイントにファイルを送信する方法と関係があると確信しています。誰かが私を助けてくれますか?
は、ドキュメントに応じて任意です。しかし、私はそれを追加しようとしましたが、違いはありませんでした。 – noor
あなたはどのmimeTypeを追加しましたか? –
私はmimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'をアップロードして、アップロードしているdocxファイルを受け入れるようにしました – noor