I recently created a script that creates a txt file in a randomly named folder within a specified folder. I would like to know how I can make this txt file automatically download...?
I have heard of placing the URL within an iframe or even using a meta refresh tag to download it, but since I'm working with a .txt file, by default it would load the file within the browser instead of present the user with a downloadable file. This is an inconvenience to a lot of people because then they have to manually save the file (I wouldn't mind, but a lot of other people would). By the way, the download link is parsed with PHP. Not sure if that matters.
Is there something I can do with .htaccess to force the file to be downloaded?
Thanks in advance.