I am using asana SDK to upload an attachment to an asana task.
const Asana = require('asana');
const fs = require("fs");
let client = Asana.ApiClient.instance;
let token = client.authentications['token'];
token.accessToken = '<YOUR_ACCESS_TOKEN>';
let attachmentsApiInstance = new Asana.AttachmentsApi();
let opts = {
'resource_subtype': "external",
'file': fs.createReadStream("file_example"),
'parent': "parent_example",
'url': "url_example",
'name': "name_example",
'connect_to_app': true,
'opt_fields': "connected_to_app,created_at,download_url,host,name,parent,parent.created_by,parent.name,parent.resource_subtype,permanent_url,resource_subtype,size,view_url"
};
attachmentsApiInstance.createAttachmentForObject(opts).then((result) => {
console.log('API called successfully. Returned data: ' + JSON.stringify(result.data, null, 2));
}, (error) => {
console.error(error.response.body);
});
what if the image is saved in S3 and I have the presigned s3 url. What file format should I convert the downloaded image into so that it can be used?