How to set content-disposition header in API connector

Hi,

I’ve exposed an endpoint to hit a backend workflow and give back a calendar, via an ics. This is working fine.

I’ve set the content type as “text/calendar; charset=utf8”, and when my endpoint is hit from a browser, it begins a download file process, as intended.
image

My problem is that to specify the filename (eg with the id of the calendar), you normally do it in the content-disposition header, with a value something like inline; filename=“calendar-123456.ics”

Since I don’t know how to set this header, the browser is defaulting a filename based on the workflow name. This works, but is not ideal, since I lose all connection to the id of the calendar that the data represents.

Does anybody know how to do this, if at all?

Thanks,
Jason

1 Like

did you get anywhere on this? I’m having a similar problem where I want to use content-disposition.
The api documentation for the API I’m trying to call has this:
-F ‘file=@/path/to/file/file.pdf;filename=desired_filename.pdf’
But if I try to pass a file’s URL with ; filename=desiredfilename - it just blows up.
The api documentation suggests using this:
Content-Disposition: form-data; name=“file”; filename=“your_document_id
I’m tempted to put that in the header with [ ] for your document id ?

Hi,

No, I have not gotten any further on this,

The issue is that there is no way to specify/modify any header except for content-type, when returning data from an api.

If there was a way to specify the content-disposition, then I know, 100%, that it would work.

1 Like