使用API​​将图像上传到任务

问题描述:

我使用bellow命令将图像上传到任务。使用API​​将图像上传到任务

卷曲-u:--form “[email protected]https://app.asana.com/api/1.0/tasks/1337/attachments

它运作良好。这个问题与我使用Asana网站上传图片不同,该文件被下载而不是在浏览器中显示。

编辑:Jpeg的作品,但PNG没有。 “type = image/png”不起作用。

谢谢,

您可能需要在上传中包含内容类型。像--form "[email protected];type=image/png"应该工作。

+0

谢谢,我会试试这个。由于jpg没有这些信息,我没有尝试过。 – 2014-09-11 01:38:29

+0

我试过了,但它也不起作用。 :-( – 2014-09-11 01:50:53

+0

你能粘贴你使用的确切curl命令吗?我用过:'curl -u $ ASANA_API_KEY:--form“[email protected]; type = image/png”https://app.asana.com/api/1.0/tasks/$ TASK_ID/attachments',它与png文件一起工作 – agnoster 2014-09-11 04:58:53