# Sqlite with Image base64

**URL:** <https://forum.ionicframework.com/t/sqlite-with-image-base64/153641>\
**Category:** ionic-v3\
**Created:** [January 20, 2019, 3:51pm UTC](https://forum.ionicframework.com/t/sqlite-with-image-base64/153641 "2019-01-20T15:51:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KamayaniT](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@KamayaniT](https://forum.ionicframework.com/u/KamayaniT)\
**Post date:** [January 20, 2019, 3:51pm UTC](https://forum.ionicframework.com/t/sqlite-with-image-base64/153641/1 "2019-01-20T15:51:18Z")

</div>

My aim is to store captured photos or whatever image is selected from gallery in my database for offline management of images. I have created sqlite database but I do not understand how to store base64 image in db  
to capture images, I am using Camera plugin  
`addPhoto(sourceType)  
{

```
const options: CameraOptions = {
  quality: 100,
  destinationType: this.camera.DestinationType.DATA_URL,
  encodingType: this.camera.EncodingType.JPEG,
  mediaType: this.camera.MediaType.PICTURE,
  correctOrientation: true,
  sourceType:sourceType

}

this.camera.getPicture(options).then((imageData) => {

 // If it's base64 (DATA_URL):
 let base64Image = 'data:image/jpeg;base64,' + imageData;
 console.log(base64Image);
}, (err) => {
 // Handle error
});

```

}`
