How can I add an image file into json object?

后端 未结 3 1899
失恋的感觉
失恋的感觉 2020-11-28 03:58

I want to add an image file into json object . Is it possible to add image file into json object?

I tried below code but its not working ? Because i want to send tha

3条回答
  •  迷失自我
    2020-11-28 04:31

    You're only adding the File object to the JSON object. The File object only contains meta information about the file: Path, name and so on.

    You must load the image and read the bytes from it. Then put these bytes into the JSON object.

提交回复
热议问题