Answers for "angularfire upload file"

0

upload files with angular

fileChange(element) {
  this.uploadedFiles = element.target.files;
}

upload() {
  let formData = new FormData();
  for (var i = 0; i < this.uploadedFiles.length; i++) {
    formData.append("uploads[]", this.uploadedFiles[i], this.uploadedFiles[i].name);
  }
  this.http.post('/api/upload', formData)
    .subscribe((response) => {
    console.log('response received is ', response);
  })
}
Posted by: Guest on October-24-2021
0

how to store image in realtime firebase using angularfire2 and angular 8

if (file.type.match('image.*')) {
  // do something
} else {
  alert('invalid format!');
}
Posted by: Guest on August-24-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language