Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

download filename from server with '#' in file name #503

Open
zebraspb opened this issue Nov 17, 2021 · 1 comment
Open

download filename from server with '#' in file name #503

zebraspb opened this issue Nov 17, 2021 · 1 comment

Comments

@zebraspb
Copy link

zebraspb commented Nov 17, 2021

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')

@bugy
Copy link
Owner

bugy commented Nov 17, 2021

Hi, thanks for reporting!

@bugy bugy added the bug label Nov 17, 2021
@bugy bugy added this to the 1.18.0 milestone Dec 4, 2022
@bugy bugy added the resolved label Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants