Is there a way to set the name of a download file to a value passed in as a query parameter?

I have a web API that gets and downloads a file when the end point is hit. Is there a way to set the download file name to a value that is passed into the web API as a query parameter?

We don't want to permanently rename the actual file itself, just the download file which the user gets when they hit the endpoint.#

Below is what I have so far.

Thanks for any help!

  Discussion posts and replies are publicly visible