Linked Questions
220 questions linked to/from How can I convert an image into Base64 string using JavaScript?
2 votes
1 answer
12k views
Convert jpg/png to base64 using javascript and cordova 2.2.0 [duplicate]
Application I'm working on I'm working on a Cordova 2.2.0 application that's used in a slow-(or none)internet environment. It gains data from a CMS system. this data (JSON) is stored locally on the ...
1 vote
1 answer
2k views
How can I convert an image to base64 using input field when user clicks save [duplicate]
I have a form. When user click save, i want to get the image that he/she selected and convert it to base64 and return that. Is it possible? This is my CODE so far <script src="jquery-2.1.4.min.js"...
1 vote
0 answers
1k views
How to issue a post to a json rest api with a base64 encoded html input from a SPA [duplicate]
I'm developing an application with a SPA as frontend and a json rest API as backend. There's a rest endpoint for creating an entity with attributes and a binary file, for example a research papaer ...
0 votes
1 answer
978 views
How to get URL image as Base64 image data for zipping using JSZip [duplicate]
I am working on a web project using Node.js, HTML5, CSS5 and Jquery. I need to get an image from the server using a URL (eg. address.com/image.jpg) as Base64 image data for zipping using JSZip. Can ...
0 votes
1 answer
918 views
How to convert image to base64 before upload [duplicate]
Possible Duplicate: How to convert image into base64 string using javascript I need to post an image using AJAX, but IE does not support it. So I would like to know if I can convert the image to ...
1 vote
1 answer
706 views
Load image from a url and convert it to a base64string [duplicate]
I am trying to load an image from a url and convert it to a base64 string. All i get is a string but when I use it as the html source of the image, the images is always blank. What am I doing wrong? ...
1 vote
0 answers
318 views
Angular 2 - Image to base64 [duplicate]
For a project I'm working on I need to generate a pdf with the logo of the company. For this, I'm using the jspdf library in Angular 2. The addImage() requires a base64 string. I'm not quite sure if ...
0 votes
0 answers
201 views
How to convert an image to a base64 string? [duplicate]
I'm trying to convert an image to a base64 string. I am using an Html code to get the input image from the user. The image is of type file. In my Javascript program I made the following call and ...
0 votes
0 answers
182 views
JavaScript/jQuery - Convert Image to Base64 [duplicate]
I got following Code in jQuery: $.get("img/background.jpg", function(img){ // Convert img to base64 var base64Img = $.base64.encode(img); }); The Plugin I am using in the example is https://...
1 vote
1 answer
67 views
Issue with embedding image data [duplicate]
My code (adapted from answer on embedding image data here: Convert binary data to base64 with javascript) <!DOCTYPE HTML> <HTML> <HEAD> <script src ="./jquery-3.3.1.min.js&...
0 votes
1 answer
56 views
Please suggest that how to convert canvas into bit64? [duplicate]
I am recently started working on canvas , but i am stuck here I have to convert canvas into base64 without using canvas2html? How to do that
1277 votes
33 answers
2.2m views
How can you encode/decode a string to Base64 in JavaScript?
I have a PHP script that can encode a PNG image to a Base64 string. I'd like to do the same thing using JavaScript. I know how to open files, but I'm not sure how to do the encoding. I'm not used to ...
1655 votes
21 answers
2.8m views
How does the 'Access-Control-Allow-Origin' header work?
Apparently, I have completely misunderstood its semantics. I thought of something like this: A client downloads JavaScript code MyCode.js from http://siteA - the origin. The response header of MyCode....
384 votes
10 answers
584k views
Get image data URL in JavaScript?
I have a regular HTML page with some images (just regular <img /> HTML tags). I'd like to get their content, base64 encoded preferably, without the need to redownload the image (ie. it's already ...
462 votes
5 answers
141k views
Why were Javascript `atob()` and `btoa()` named like that?
In Javascript, window.atob() method decodes a base64 string and window.btoa() method encodes a string into base64. Then why weren't they named like base64Decode() and base64Encode()? atob() and btoa()...