无法从\目录发送带有\的文件

2024-06-17 12:52:18 发布

您现在位置:Python中文网/ 问答频道 /正文

当我试图通过以下功能将文件发送给请求它的用户时:

# Prepare selected file for download...
filepath = '/home/nikos/wsgi/static/files/'
send_from_directory( filepath, filename, as_attachment=True )

我得到错误:

Bad Request
The browser (or proxy) sent a request that this server could not understand.

为什么错误没有提供文件,而是提到代理或错误请求?
该脚本是在中启用了指令 WSGIPassAuthorization On的mod\u wsgi脚本httpd.conf文件你知道吗


Tags: 文件用户功能脚本wsgihomefordownload