当文件位于文件系统根目录中时,如何使文件可供下载。例如,在ubuntu操作系统的“media”目录中?你知道吗
Python:
#bottle 0.12.10
@route('/download/<filename:path>')
def staticdownloadfile(filename):
return bottle.static_file(filename, root='/media', download=filename)
html格式:
<a href="/static/media/somefile.extension">download here</a>
上述方法不起作用?找不到404。你知道吗
在html文件中,您应该使用另一个链接:
因为在应用程序中,您定义了:
相关问题 更多 >
编程相关推荐