M
M
Mikhail Ivanov2016-05-16 08:13:52
JavaScript
Mikhail Ivanov, 2016-05-16 08:13:52

Java: What is the correct way to send byte[] (image) to be processed into json?

Good afternoon!
There is a database in which there is an image (jpg) in byte[], also in the database is the name of the client and his last name. Using the method, I get the Client (first name, last name, image), and accept using ajax - dataType: "json", everything is displayed well except for the image. Tell me how to correctly implement sending data or process them correctly upon receipt?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rou1997, 2016-05-16
@Rou1997

An image in JSON is a bust, where have you seen this?
In JSON, you need to transfer a link to the image ... Or better, only its id, and then let JavaScript form a link with the id, since in JSON you generally need to transfer a minimum of bytes, it is already not parsed very quickly.

A
anton achehe, 2016-06-07
@mr-achehe

Url.urlencode(image.getBase64()) send accept url.urldecode

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question