Database download with code page

hello, I really need the community’s help, I need to allow my users to download the .csv database, using the code on the page, I’ve tried several posts that used to work using html, but it doesn’t work anymore the action of download.