2017-04-19 46 views

回答

0

Cloudinary提供了很好的角度SDK,你可以使用它。 1.安装适用于相关Angular版本的Javascript SDK和Angular SDK

Cloudinary Angular SDK作为Cloudinary Javascript库的顶层。安装Cloudinary Javascript库和角SDK的格式相关版本:

NPM安装cloudinary核@ cloudinary/angular- --save :输入对应的角版本的角度SDK包您正在使用,如2.x,4.x或5.x.例如:

NPM安装cloudinary核@ cloudinary /角5.x的--save ....由Cloudinary队更多信息click here

另一个很容易实现click here

或者,如果要使用本机只是文件传输的插件,然后使用: 我认为这个链接将使用文件转第帮你http://www.developerslearnit.com/2016/11/build-photo-gallery-app-with-ionic2.html

它完成lugin。

fileTransfer.upload(this.imageNewPath, 'yourUrlHere', 
     options).then((entry) => { 
     this.imagePath = ''; 
     this.imageChosen = 0; 
     loader.dismiss(); 
     this.navCtrl.setRoot(HomePage); 
     }, (err) => { 
     alert(JSON.stringify(err)); 
     }); 

另一个很好的例子是在这里https://devdactic.com/ionic-2-images/ 这个例子可以用于上传到托管服务器上的任何文件。