【发布时间】:2020-01-14 03:30:57
【问题描述】:
下午好。我正在尝试用瓶子下载文件。但它总是以 .html 格式下载它。如何将其更改为 .txt?非常感谢。我的代码如下:
@get('/api/v1/descargarHist/<id>')
def descargar (id):
directorio, fichero = Repo.recuperar_historial(id)
return static_file(fichero, root=directorio,download='{}.txt'.format(id))
无论我怎么努力,我都无法改变它。它总是将其下载为 .html 有没有办法做到这一点?
【问题讨论】: