Thumbnail Files Created Through Email Versus the API


#1

@Jeff_Schneider @Matt_Bramlage I have noticed that files sent through email to the project email address properly show a thumbnail in the file list program but files uploaded through the API do not. Can you suggest any reason this may occur. Files%20Thumbnails


#2

Well spotted!


#3

@Jeff_Schneider @Matt_Bramlage @Joe_Trollo any thoughts?

Thanks


#4

Sorry, but at this time the API does not automatically detect the file type for uploads, and without the type Asana cannot generate the thumbnail. However, if you specify the type in your request then a thumbnail will be generated if possible. For example, this curl request will not generate a thumbnail:

$ curl https://app.asana.com/api/1.0/tasks/123/attachments -H "Authorization: Bearer <token>" -F file="@image.png"

However, this curl request will generate a thumbnail:

$ curl https://app.asana.com/api/1.0/tasks/123/attachments -H "Authorization: Bearer <token>" -F file="@image.png;type=image/png"

I would consult the documentation for the HTTP client you are using to determine how to set the file type for uploads.


#5

@Joe_Trollo Fortunately by developer @EricLegault has figured out a a way to have the API upload recognize the file type for those that are visible. We are about to release a new version of sendana.net that reflects this. Thanks for the suggestions.