Description
Version 1.16.
Files on my server is log#XXX.txt
// get log sh just print "start to download $1"
I try to download it with config:
{
"name": "Download logs",
"script_path": "/home/scripts/getlog.sh",
"working_directory": "/home/",
"requires_terminal": true,
"parameters": [
{
"name": "server_file",
"required": true,
"type": "server_file",
"file_type": "file",
"file_extensions": [
"txt"
],
"file_dir": "/home/",
"file_recursive": true
}
],
"output_files": [
"${server_file}"
]
}
Any files .txt a can dowload. But file (for ex) log#123.txt - i see link to download, but download not start.
src/web/server.py
class DownloadResultFile(AuthorizedStaticFileHandler):
@check_authorization
def validate_absolute_path(self, root, absolute_path):
absolute_path here is a string from begin to log.
all from # is lost.
I patch it with:
src/utils/file_utils.py
create_unique_filename
preferred_path = preferred_path.replace('#','N')