I am using ionic2 beta 11 and firebase 3. I would like to try to upload some image to firebase storage. I have setup a home.ts but I encounter following error :
Error TS2345: Argument of type 'string' is not assignable to parameter of type 'Blob'.
// follow the instruction of https://firebase.google.com/docs/storage/web/upload-files
import * as firebase from 'firebase';
public storageRef : any;
constructor () {}
uploadfile(){
var file = "http://imgs.sundaykiss.com/wp-content/uploads/2016/08/278k_kissfocus09.jpg";
var metadata = {
contentType: 'image/jpeg'
};
var storageRef = firebase.storage().ref('images/' + file);
var uploadTask = storageRef.put(file, metadata);
// the editor wanted me the file above, argument of type 'string' is not assignable to parameter of type 'Blob'.
May I know why ? Many thanks.