0

I'm having some trouble uploading an image to an asana task. I get a 200 on the response but when I navigate to the image it is not loading and appears broken.

Here is what my request header looks like:

https://app.asana.com/api/1.0/tasks/<TaskId>/attachments - Http Post

Authorization: Bearer <o-auth token>
Content-Type: multipart/form-data; boundary=ASANA_BOUNDARY
Host: app.asana.com
Accept: */*
Content-Length: 1457324
Fiddler-Encoding: UTF8

Here is what the body of my request looks like:

--ASANA_BOUNDARY
Content-Disposition: form-data; name="file"; filename="koala.jpg" 
Content-Type: image/jpeg

<Raw Data>

--ASANA_BOUNDARY--

I'm not really sure why this is giving me a 200 and then no image loads. I formed my request as noted in the documentation.

  • Are you using one of the first party libraries? If not, can you reproduce this using curl? – agnoster Dec 14 '15 at 11:09
  • I figured out my issue. The issue was that I was not base64 encoding the whole request body I was just encoding the bytes of my image. I encoded the whole body and everything started working fine. Thanks! – Chris Stopher Dec 15 '15 at 17:48

0 Answers0