@sehsah2020 wrote:
hi ,
when i upload image with input text .
input text only send to databasecode add.ts
let postData = { "username": this.username, "fullname": this.fullname, "cat": this.cat, "country": this.country, "sex": this.sex, "image": this.imageData, } let data:Observable<any> = this.http.post(this.url+/api/addsnap',postData ); data.subscribe((res) => { console.log(res); });
code select
takePicture(sourceType) { const options: CameraOptions = { quality: 50, sourceType: sourceType, destinationType: this.camera.DestinationType.FILE_URI, encodingType: this.camera.EncodingType.JPEG, mediaType: this.camera.MediaType.PICTURE, } this.camera.getPicture(options).then((imageData) => { this.imageData = 'data:image/jpeg;base64,' + imageData; this.correctPath = imageData.substr( imageData.lastIndexOf('/') + 1); console.log("imageData"+this.correctPath); }, (err) => { // Handle error });
Posts: 1
Participants: 1