Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74491

Bottle and Python. Change format of a static_file while downloading

$
0
0

Good afternoon. I am trying to download a file with bottle. But it always downloads it with a .html format. How can i change it to a .txt? Thank you very much. My code is the following:

@get('/api/v1/descargarHist/<id>')
def descargar (id):
directorio, fichero = Repo.recuperar_historial(id)
return static_file(fichero, root=directorio,download='{}.txt'.format(id))

No matter how much i try, i can't change it. It always downloads it as a .html Is there a way to do this?


Viewing all articles
Browse latest Browse all 74491

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>