2

enter image description hereawait fetch("https://******?filename=amit.png", { method: "POST", params: {filename : "amit.png"}, headers: { Authorization: "Basic *****", "Content-Type": "image/jpeg" }, body: feedbackData.photo.base64 })

in body i am passing base64 , the image which is showing on server is empty. i am missing some thing in body. please help.

  • Rather than sending the file as boday send it as a formdata. let formData = new FormData(); formData.append('file', { uri: uriOfTheFile, type: 'image/jpeg/jpg', name: nameOfTheFile, data: theFile, }); await fetch("https://******?filename=amit.png", { method: "POST", params: {filename : "amit.png"}, headers: { Authorization: "Basic *****", "Content-Type": "imultipart/form-data" }, body: formData }) For reference and example follow this answer https://stackoverflow.com/a/59518315/10398005. I hope you get some Idea what exactly to do. – Pratap Sharma Jan 12 '20 at 14:13
  • 1
    Hi @PratapSharma thanks for the help but zendesk api not supporting to fromdata, its only supporting binary. could you help me to convert in binary. i tried few library but not supporting with expo – Amit_Chauhan Jan 13 '20 at 07:22

0 Answers0