Send image as attachment


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(""+testID+"/attachments", obj).then(function(res) {
I'm sending image to Wrike, but I'm having an error "The file is damaged or contains errors".
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Can you help? Answer the question and work your way towards becoming a Wrike Ninja 🥋 Sign in and answer.

Please sign in to leave a comment.

Folllowing List for Post: Send image as attachment
[this list is visible for admins and agents only]

Didn’t find what you were looking for? Write new post