Linked Questions

1286 votes
8 answers
1.2m views

How can I do Base64 encoding in Node.js?

Does Node.js have built-in Base64 encoding yet? The reason why I ask this is that final() from crypto can only output hexadecimal, binary or ASCII data. For example: var cipher = crypto.createCipheriv(...
murvinlai's user avatar
  • 50.5k
0 votes
0 answers
490 views

How to decode base64 audio content and save the decoded output in firebase storage from a firebase cloud function [duplicate]

Google text to speech returns the output audio as base64 string. I want to save that string into firebase storage. The following code saves the sting as base text not as binary and so not playable. ...
MSaudi's user avatar
  • 4,682
54 votes
7 answers
48k views

How do I upload a base64 encoded image (string) directly to a Google Cloud Storage bucket using Node.js?

Currently, I am using the @google-cloud/storage NPM package to upload a file directly to a Google Cloud Storage bucket. This requires some trickery as I only have the image's base64 encoded string. I ...
JackH's user avatar
  • 4,745
9 votes
1 answer
33k views

Decode Base64 string in node.js

I'm trying to decode a base64 string representing an image stored in a db. I tried many libraries and solutions provided on SO, but I'm still unable to decode the image correctly. In particular, ...
SimoV8's user avatar
  • 1,412
4 votes
1 answer
17k views

TypeError Base64 is not a function when using Buffer.from in Node 4.3

I am debugging a lambda function locally on Node 4.3 using the standard Amazon Machine Image (linux x64) When I run the program, I get an error in a function that is meant to decode a base64 string ...
Taylor Ackley's user avatar
4 votes
1 answer
13k views

Converting mongodb Binary _id to LUUID using node

I'm trying to move data from mongodb to mysql I used mongoexport in order to export the data from the mongodb database to .json files When I browse my mongodb collection using robomongo I'm getting ...
Yaron U.'s user avatar
  • 7,923
0 votes
3 answers
17k views

Axios Basic Auth with API key Example in Node

There is a curl request like this: curl -X GET --header 'Accept: application/json' --header 'Authorization: Basic [==APIKEYHERE==]' 'https://apipath.com/path?verbose=true' I removed the APIKEY and ...
Jordash's user avatar
  • 3,123
0 votes
3 answers
4k views

Access user data in AWS lambda function with custom authorizer

I got a nodeJS lambda function which returns database data and I'd like to filter that data based on the user. I created a custom authorizer lambda function which gets the user for a JWT token, but I ...
quambo's user avatar
  • 480
0 votes
2 answers
3k views

Is there a common encrypt method between PHP and Javascript?

I want to encrypt my users ID with php, send them to javascript. and decrypt them in javascript. Is there any common method for encrypting and decrypting between different languages ? I am using ...
Pars's user avatar
  • 5,312
1 vote
2 answers
4k views

unable to get the value of decoded base64 data in node

this value was encoded to base64 { a: "008078888658936", b: "REA" } and was decoded using this code var mytokenvalue = "ewphOiAiMDA4MDc4ODg4NjU4OTM2IiwKYjogIlJFQSIKfQ==" ...
Afeez Olawale's user avatar
7 votes
1 answer
6k views

How do you encode a file to base64 then upload as multipart file to backend api using JS?

I am trying to develop a micro-service to receive base64 encoded data. When I tried to send it over 6 MB of data, I am getting below error - The multi-part request has parameterized data(excluding ...
bash's user avatar
  • 123
0 votes
1 answer
4k views

node js base64 string into utf8 issue

I have a string which is base64 and I need to convert it into utf-8. base64_string "VABpAG0AZQAgAHMAZQByAGUAaQBzAA==" I am trying to convert base64_string into utf-8 in the following env: In browser ...
rachit's user avatar
  • 25
0 votes
2 answers
2k views

Transforming Blob().text() to a File()

I want to send a generated image from a React frontend to an Express server but since I can't send a Blob() object with axios (I get an empty object) my idea was to get the raw image data with Blob()....
Rik Verbeek's user avatar