0

I am uploading an image to a task using bellow command.

curl -u : --form "file=@file.txt" https://app.asana.com/api/1.0/tasks/1337/attachments

It works well. The issue is unlike I upload an image using Asana website, the file is downloaded instead of showing in the browser.

Edited: Jpeg works but png does not. "type=image/png" doesn't help.

Thanks,

Eric Shim
  • 55
  • 5

1 Answers1

0

You may need to include a content type in the upload. Something like --form "file=@test.png;type=image/png" ought to work.

agnoster
  • 3,744
  • 2
  • 21
  • 29
  • Thanks, I will try this. Since jpg worked without this information, I haven't tried this. – Eric Shim Sep 11 '14 at 01:38
  • Can you paste the exact curl command you used? I used: `curl -u $ASANA_API_KEY: --form "file=@test.png;type=image/png" https://app.asana.com/api/1.0/tasks/$TASK_ID/attachments` and it worked with a png file. – agnoster Sep 11 '14 at 04:58
  • it works. Looks like my script has some typo. Thanks, – Eric Shim Sep 12 '14 at 05:44