Hi, so I’m trying to upload an image to UploadCare, but the event.json() comes with an error saying
Property ‘json’ does not exist on type ‘Object’
here’s my code:
uploadPic(event){
const files = event.target.files
const data = new FormData()
data.append('file', files[0])
data.append('UPLOADCARE_STORE', '1')
data.append('UPLOADCARE_PUB_KEY', 'myapikey')
this.http.post('https://upload.uploadcare.com/base/', data).subscribe(event=>{
console.log(event)
const uuid = event.json().File
this.mainuser.update({
profilePic: uuid
})
})
}