2017-04-19 39 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/ 這個例子可以用於上傳到託管服務器上的任何文件。