Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Base64 image upload in Web but not upload in a device via Ionic

$
0
0

@vinimendes3 wrote:

I'm developing an app and trying to upload an image in base64 to my server. Testing the code via web it works perfectly! And when I convert the image in base64 to File, it returns me the following object:

But when I try to make the same thing in my mobile app running on an Android device, the same code creates to me the following File object:

What is happening? I call the function to convert my base64 image to File as this:

var blob = new Blob([photoBase64], {type: 'image/png'});
var filePhoto = new File([blob], "employeePhoto.png");

It is very strange that the same code gets different results when running via Web Browser and running via Android.

In first image (which worked) I was running on web browser.
In second image (not worked) I was running on Android app.
It is the same code...

It appears that File constructor have different behavior in web browser and Android app. I am not understanding this. Passing the parameters to File constructor in the same order create different File objects (as the described on images).

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>