0

My java spring boot app is sending JSON that includes a multi-part file, which I need to parse(using angular) in order to target 'picture" inside of "fileupload" when GET is called.

Here is the JSON coming to UI when GET is called:

{
"id": 1,
"name": John,
"fileupload":  "MemberFile(id=1, fileId=1, fileName="sample.png", picture=[-119, 80, 78, 71, 13,..., -126])"
}

Any help would be greatly appreciated. Let me know if more details are needed. Thanks

Sreehari K
  • 887
  • 6
  • 16

1 Answers1

0

Use JSON.parse to parse your string to javascript object.

const json = '{ "id": 1 "name": John "fileupload": "MemberFile(id=1, fileId=1, fileName="sample.png", picture=[-119, 80, 78, 71, 13,..., -126])" }';
const obj = JSON.parse(json);

console.log(obj);
// expected output: true
kup
  • 731
  • 5
  • 18