I am trying to export a particular string as a csv file and I want the user to be able to download this file. IHP has the createTemporaryDownloadUrl function that takes in a StoredFile and then creates a temporary download link. The problem is, I don't want to store this CSV file on the server since it requires additional overhead, such as deleting the file after the temporary download link has expired.
I am able to render the text variable using renderPlain, but I'm not entirely sure how to automate the downloading process (since the user would have to right click, download as, and then rename the file themselves)
I first tried using the regular createTemporaryDownloadUrl method by storing the file, but there is no easy way of deleting the file after the temporary download url expires. I'm able to display the CSV contents as a plain text file, but there is no obvious way of having the user download it.