# How i upload images using ionic 4 in PWA

**URL:** <https://forum.ionicframework.com/t/how-i-upload-images-using-ionic-4-in-pwa/175273>\
**Category:** Ionic Framework\
**Created:** [October 10, 2019, 4:06pm UTC](https://forum.ionicframework.com/t/how-i-upload-images-using-ionic-4-in-pwa/175273 "2019-10-10T16:06:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![israeldavid](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/israeldavid/32/127760_2.png) [@israeldavid](https://forum.ionicframework.com/u/israeldavid)\
**Post date:** [October 10, 2019, 4:06pm UTC](https://forum.ionicframework.com/t/how-i-upload-images-using-ionic-4-in-pwa/175273/1 "2019-10-10T16:06:03Z")

</div>

Hi i have a ionic develop with and works great in the front end, but i dont know how send this picture to backend.? JSON Objetc? String? base64? how i convert the input file to base64? considering this pwa and cordova doesnt work.

Thanks,

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [October 10, 2019, 7:00pm UTC](https://forum.ionicframework.com/t/how-i-upload-images-using-ionic-4-in-pwa/175273/2 "2019-10-10T19:00:10Z")

</div>

The decision tree looks somewhat like this:

A. Do you control the backend? If not, ask whoever does what format it needs to be in. Done.

B. Are you storing the picture in something that can handle binary data, or only strings with a limited character set? If backend can handle binary, keep going. Otherwise, base64 (either as part of a JSON object or standalone) is probably your best choice.

C. Do you care about the 33% overhead that base64 imposes? If not, go back to B and pretend that the backend can’t do binary.

D. Manage the picture within the Ionic app as an `ArrayBuffer`, send it in raw binary to the backend, and store it that way. This is the most bandwidth- and storage-efficient plan.

---

<div class="post-metadata">

**Author:** ![israeldavid](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/israeldavid/32/127760_2.png) [@israeldavid](https://forum.ionicframework.com/u/israeldavid)\
**Post date:** [October 10, 2019, 7:36pm UTC](https://forum.ionicframework.com/t/how-i-upload-images-using-ionic-4-in-pwa/175273/3 "2019-10-10T19:36:39Z")

</div>

hi, option D, i code it and works great !!! Thanks a lot.

---

<div class="post-metadata">

**Author:** ![lalitkumarbaghel](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lalitkumarbaghel/32/128826_2.png) [@lalitkumarbaghel](https://forum.ionicframework.com/u/lalitkumarbaghel)\
**Post date:** [October 11, 2019, 7:11am UTC](https://forum.ionicframework.com/t/how-i-upload-images-using-ionic-4-in-pwa/175273/4 "2019-10-11T07:11:09Z")

</div>

Bro I am Ionic Capacitor Developer and I am shifted from Cordova to Capacitor.this small tutorial will help you to browse any image file.this is also able to browse image from browser side without using pwa too.

> **[Ionic 4 Capacitor Choose file for Android and IOS](http://www.expertsuggestion.com/2019/10/ionic-4-capacitor-choose-file-for.html)**
>
> I was developing an app in ionic 4 using Capacitor for android and IOS. I can't find any way to choose a file using Capacitor's api. I had looked for method in the Capacitor's "Filesystem" api...
