Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs Ionic2和Angular2图像上传示例?_Angularjs_Angular_Ionic Framework_Ionic2 - Fatal编程技术网

Angularjs Ionic2和Angular2图像上传示例?

Angularjs Ionic2和Angular2图像上传示例?,angularjs,angular,ionic-framework,ionic2,Angularjs,Angular,Ionic Framework,Ionic2,此代码不起作用。 名称 形象 要使用Ionic 2 Framework将图像上载到服务器,必须使用传输插件。 使用安装传输插件 ionic plugin add cordova-plugin-file-transfer npm install --save @ionic-native/transfer 然后从Transfer类调用upload函数 const fileTransfer: TransferObject = this.transfer.create(); let opti

此代码不起作用。


名称
形象

要使用Ionic 2 Framework将图像上载到服务器,必须使用传输插件。 使用安装传输插件

ionic plugin add cordova-plugin-file-transfer
npm install --save @ionic-native/transfer
然后从Transfer类调用upload函数

const fileTransfer: TransferObject = this.transfer.create();

  let options1: FileUploadOptions = {
     fileKey: 'file',
     fileName: 'name.jpg',
     headers: {}

  }

 fileTransfer.upload(imageDataLocalURL, 'http://localhost/ionic/upload.php',  options1)
.then((data) => {
 // success
 alert("success");
}, (err) => {
 // error
 alert("error"+JSON.stringify(err));
});

使用链接了解更多信息

要使用Ionic 2 Framework将图像上载到服务器,必须使用传输插件。 使用安装传输插件

ionic plugin add cordova-plugin-file-transfer
npm install --save @ionic-native/transfer
然后从Transfer类调用upload函数

const fileTransfer: TransferObject = this.transfer.create();

  let options1: FileUploadOptions = {
     fileKey: 'file',
     fileName: 'name.jpg',
     headers: {}

  }

 fileTransfer.upload(imageDataLocalURL, 'http://localhost/ionic/upload.php',  options1)
.then((data) => {
 // success
 alert("success");
}, (err) => {
 // error
 alert("error"+JSON.stringify(err));
});

使用链接了解更多信息

我可以一次点击使用多个图像上传吗?我仍然没有找到解决方案我可以一次点击使用多个图像上传吗?我仍然没有找到解决方案