Send image as attachment
Hi!
I would like to know, how can I send image as attachment in React Native application?
I'm using FileReader() and .readAsDataURL() method to read image.
var obj = {
method: 'POST',
body: img,
headers: {
'Authorization': 'bearer '+accessToken,
'X-File-Name': "example-shrunk.png",
'Content-Type': 'application/octet-stream',
'X-Requested-With': 'XMLHttpRequest',
},
};
fetch("https://www.wrike.com/api/v4/tasks/"+testID+"/attachments", obj).then(function(res) {
console.log(res);
});
I'm sending image to Wrike, but I'm having an error "The file is damaged or contains errors".
Can you help? Answer the question and work your way towards becoming a Wrike Ninja 🥋 Sign in and answer.
Войдите в службу, чтобы оставить комментарий.