# Uploading a Video \[solved\]

**URL:** <https://forum.ionicframework.com/t/uploading-a-video-solved/27436>\
**Category:** ionic-v1\
**Created:** [July 1, 2015, 12:35am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436 "2015-07-01T00:35:00Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffchuber](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jeffchuber/32/90557_2.png) [@jeffchuber](https://forum.ionicframework.com/u/jeffchuber)\
**Post date:** [July 1, 2015, 12:35am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/1 "2015-07-01T00:35:00Z")

</div>

I’m trying to upload a video from the camera roll. This is my code. iOS returns null for data for a video, but returns the right filepath for an image. Can’t tell where the bug is occurring - but it does not seem intended! Any help would be awesome.

```auto
$scope.chooseVideos = function() {
  var options = {
    destinationType: Camera.DestinationType.FILE_URI,
    sourceType: Camera.PictureSourceType.SAVEDPHOTOALBUM,
    mediaType: Camera.MediaType.ALLMEDIA
  };
 
  $cordovaCamera.getPicture(options).then(function(data) {
    console.log("data from chooseVideos", data);
    // $scope.media.push(data.localURL);
  }, function(error) {
    // error getting photos
  });
}

```

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [July 1, 2015, 6:22am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/2 "2015-07-01T06:22:57Z")

</div>

you are using the wrong plugin [http://ngcordova.com/docs/plugins/capture/](http://ngcordova.com/docs/plugins/capture/) 😉

---

<div class="post-metadata">

**Author:** ![jeffchuber](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jeffchuber/32/90557_2.png) [@jeffchuber](https://forum.ionicframework.com/u/jeffchuber)\
**Post date:** [July 1, 2015, 6:48am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/3 "2015-07-01T06:48:23Z")

</div>

actually that plugin works fine now. I got it working. The issue is inconsistent local filepaths cross images and videos. images inclue file:/// - videos do not.

---

<div class="post-metadata">

**Author:** ![bengtler](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/bengtler/32/98565_2.png) [@bengtler](https://forum.ionicframework.com/u/bengtler)\
**Post date:** [July 1, 2015, 7:49am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/4 "2015-07-01T07:49:56Z")

</div>

lols nice to know. ^^

---

<div class="post-metadata">

**Author:** ![infocular](https://avatars.discourse-cdn.com/v4/letter/i/b9bd4f/32.png) [@infocular](https://forum.ionicframework.com/u/infocular)\
**Post date:** [February 9, 2016, 12:14am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/5 "2016-02-09T00:14:06Z")

</div>

Can you tell me how exactly did you fix it as I am having the same issue. So how do we get the video path

---

<div class="post-metadata">

**Author:** ![jeffchuber](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jeffchuber/32/90557_2.png) [@jeffchuber](https://forum.ionicframework.com/u/jeffchuber)\
**Post date:** [February 9, 2016, 12:44am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/6 "2016-02-09T00:44:02Z")

</div>

hey there - you should add file:/// to retrieve the file.

the other bug which you should be aware of is that iOS will compress all videos and there is no way around this. Android will send you the uncompressed files.

---

<div class="post-metadata">

**Author:** ![infocular](https://avatars.discourse-cdn.com/v4/letter/i/b9bd4f/32.png) [@infocular](https://forum.ionicframework.com/u/infocular)\
**Post date:** [February 9, 2016, 1:01am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/7 "2016-02-09T01:01:39Z")

</div>

> [@jeffchuber](#):
>
> file:///

Do you have skype so u mean i should just when i allert concatenate file:/// along with it

---

<div class="post-metadata">

**Author:** ![infocular](https://avatars.discourse-cdn.com/v4/letter/i/b9bd4f/32.png) [@infocular](https://forum.ionicframework.com/u/infocular)\
**Post date:** [February 9, 2016, 3:52am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/8 "2016-02-09T03:52:45Z")

</div>

Still not able to understand what you mean you should add file:/// to retrieve the file. Please can explain with code

---

<div class="post-metadata">

**Author:** ![gowda](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@gowda](https://forum.ionicframework.com/u/gowda)\
**Post date:** [March 25, 2016, 10:01am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/9 "2016-03-25T10:01:12Z")

</div>

ur problem is solved or not…can send me the demo

---

<div class="post-metadata">

**Author:** ![PradeepGill](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@PradeepGill](https://forum.ionicframework.com/u/PradeepGill)\
**Post date:** [April 15, 2016, 1:11pm UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/10 "2016-04-15T13:11:36Z")

</div>

@gowda @bengtler @jeffchuber  
Hi all i am also getting the same problem as i am trying to access the video path using $cordovaCamera plugin, here is my code:-

`$scope.getVideoPath = function(){ var options = { quality: 50, destinationType: Camera.DestinationType.DATA_URL, sourceType: Camera.PictureSourceType.PHOTOLIBRARY, mediaType:Camera.MediaType.VIDEO }; $cordovaCamera.getPicture(options).then(function(videoURI) { console.log("videoURI",JSON.stringify(videoURI)); console.log("videoURI",videoURI.toURI()); }, function(err) { console.log("err",JSON.stringify(err)); }); }`

I am getting both the log blank 😞

---

<div class="post-metadata">

**Author:** ![nishit111](https://avatars.discourse-cdn.com/v4/letter/n/22d042/32.png) [@nishit111](https://forum.ionicframework.com/u/nishit111)\
**Post date:** [May 13, 2016, 3:16pm UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/11 "2016-05-13T15:16:50Z")

</div>

I just used it many ways and tried your way also but m getting blank data on selection of video. It means video selection library apeared but on select of video it is giving blank data… so how can i get data or file path

---

<div class="post-metadata">

**Author:** ![shahidkarimi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/shahidkarimi/32/107269_2.png) [@shahidkarimi](https://forum.ionicframework.com/u/shahidkarimi)\
**Post date:** [March 4, 2017, 7:47pm UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/12 "2017-03-04T19:47:55Z")

</div>

How to get file path?

---

<div class="post-metadata">

**Author:** ![AaronSterling](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@AaronSterling](https://forum.ionicframework.com/u/AaronSterling)\
**Post date:** [March 5, 2017, 5:46am UTC](https://forum.ionicframework.com/t/uploading-a-video-solved/27436/13 "2017-03-05T05:46:21Z")

</div>

> [@shahidkarimi](#):
>
> How to get file path?

Simple way: use a standard file button. Put this in your template:

`<input type="file" value = "upload" accept="video/*" id="videoButton" />`

Then grab the information in your ts file like so:

`let videoButton = (<HTMLInputElement>document.getElementById('videoButton'));`  
`let videoFile = videoButton.files[0];`

Then write what’s at the videoFile path to whatever database you’re using.

Once you have that working, you can make things fancier.
