# Image/File Path

**URL:** <https://forum.ionicframework.com/t/image-file-path/123209>\
**Category:** ionic-v3\
**Created:** [March 2, 2018, 11:41am UTC](https://forum.ionicframework.com/t/image-file-path/123209 "2018-03-02T11:41:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![manelbdacosta](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@manelbdacosta](https://forum.ionicframework.com/u/manelbdacosta)\
**Post date:** [March 2, 2018, 11:41am UTC](https://forum.ionicframework.com/t/image-file-path/123209/1 "2018-03-02T11:41:52Z")

</div>

Ionic v2, Android

Trying to upload an image take with the camera to a server but cant find image path.

.ts file:

```auto
public takePicture(){
 const options: CameraOptions = {
   quality: 100,
   destinationType: this.camera.DestinationType.DATA_URL,
   encodingType: this.camera.EncodingType.JPEG,
   mediaType: this.camera.MediaType.PICTURE,
   allowEdit: true
 }

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

  this.base64Image = 'data:image/jpeg;base64,' + imageData;
  
  this.photo = this.base64Image;
  this.imageURL = this.filePath.resolveNativePath(this.base64Image);
 }, (err) => {
  // Handles error
 });

public uploadImage(photo) {
 
  // File name only
  // var filename = "photo";

  // File for Upload
  var targetPath = cordova.file.externalDataDirectory;

  var url = "http://127.0.0.1:8000/upload/";
  var options = {
    httpMethod: 'POST',
    chunkedMode: false,
  };

  const fileTransfer: FileTransferObject = this.transfer.create();

  this.loading = this.loadingCtrl.create({
    content: 'Uploading...',
  });
  this.loading.present();

  // Use the FileTransfer to upload the image
  fileTransfer.upload(this.imageURL, url, options).then(data => {
    this.loading.dismissAll()
    this.presentToast('Image succesful uploaded.');
  }, err => {
    this.loading.dismissAll()
    this.presentToast('Error while uploading file.');
  });
}

```

trying to upload to a REST server!  
any idea where i might be screwing up?

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:48pm UTC](https://forum.ionicframework.com/t/image-file-path/123209/2 "2021-07-19T21:48:27Z")

</div>

Closed on July 19, 2021, 9:48pm UTC


