@iothemhz wrote:
I am trying to upload an image and I am getting the following error
this is the upload image function
uploadImage() { this.storage.get('data').then((val) => { let postData = { token : val.key, account_id : val.ac_id, photo: this.base64Image }; this.studentsProvider.uploadFile(postData).subscribe(data => { }, (err) => { this.error = 'and the error is:'+JSON.stringify(err); }); }); } this is the uploadFile function in the provider uploadFile(data : any ) { return this.http.post(this.apiUrlFileUpload,{ 'token': data.token, 'account_id': data.account_id, 'photo' : data.photo },{headers: { 'Content-Type': 'application/json' }}).map(res => res); }
the variable this.apiUrlFileUpload, is being filled manually and its not null. Can someone help?
Posts: 1
Participants: 1