S
S
Sergey2012-02-01 18:41:57
JavaScript
Sergey, 2012-02-01 18:41:57

JavaScript: convert string to byte array?

Actually, the task was to convert images to Base64 on the client side. It was decided to get the picture itself via XmlHttpRequest with responseType = 'arraybuffer'. And it would be all right if XmlHttpRequest 2 was implemented in IE and other ancient browsers.
So far, I can get the picture as a string, and it already needs to be converted to an array of bytes. Can anyone help? Everything I found is applicable only for strings containing only printable characters.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
[
[email protected]><e, 2012-02-01
@barmaley_exe

Check it out .

A
Anatoly, 2012-02-01
@taliban

Convert the string to Base64 on the server.

H
himik, 2012-02-01
@himik

there was a similar question recently. here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question