I m trying to download attachment from a API call using HTTPS REQUEST activity
I m aware that I can pass the Filename I want that gets downloaded as the attachment
But if the api can have any type of attachment in it like .eml or xlsx file, How can I mention the Filename and filetype of the attachment without knowing what it would be from api
When I tried the same with postman (with Save and Download option) I m able to download the file with its actual name and filetype
But in studio I couldn’t
Or
Is there any way to get any type of attachments from api with its actual file name and file type
Yeah
I use a coupe api url
Where I’m passing url to get the attachment like this
{url}\api\attachments{attachment id}
Where I m getting the attachment id from another url
With the above url I get Json response but it is of junk characters. I think it is trying to parse through the attachment and give as output response and it doesn’t have any Filename or filetype
With the url I use to get attachment id also doesn’t give any other details of the attachment
we did run some side-by-side checks along with different scenarios and cross-checking in Postman.
For a more reliable solution, we would recommend to set up a cascade:
check if Content-Disposition Header is available
check if the request URL can be used
Check if the above shown Result.RequestMessage.RequestUri give details
Check Response.Location
It can happen, that a file name / info still cannot be determined. Then derivation from content-type or a default name can be used as alternate / fallback
Kindly note: not every content-type allows a clear derivation of the filetype / type extension
Great
Thanks @ppr
Appreciate ur kind help
I got it resolved with Nithin’s suggestion by getting Content Deposition where it had the Filename and filetype which I used for saving my file from api
Thanks @Nithinkrishna