Creating a file download link

I have an API for an action which generates a midi file. The POST method for the endpoint generates the file and stores it on my server. In the response it returns a link to the resource/file. A GET method on the endpoint downloads the file.

This all works when I test my API manually and my CustomGPT can call the POST endpoint and GET endpoint in sequence. The issue is that it starts writing the response and I can see it generating an ‘a’ tag with an href correctly, but when the link “collapses” and renders the ‘a’ tag is not clickable and the file can’t be downloaded.

If I prompt the CustomGPT enough it will give the full URL in plain text but then I have to copy that and paste it in a browser to download the file and I’d like a user to just be able to click the link to start the download. I tried training it to include the href but then it literally wrote the HTML in the response :confused:

Bear in mind the answers are formatted in Markdown, and the internal instructions (at least of ChatGPT) tell it to not include hyperlinks other than to the sources of knowledge used in browsing.

You may have better luck if you give it the format you expect in your instruction or internal tool response prompt.

...Make sure to return the download file as a markdown hyperlink, like "[Download MIDI file](<link-from-musictheory...>) using the complete, literal, absolute link"...