Skip to content

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

Closed

Description

@zebraspb

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

Activity

  1. bugy commented on Nov 17, 2021

    @bugy
    Owner

    Hi, thanks for reporting!

  2. added a commit that references this issue on Dec 4, 2022
  3. added this to the 1.18.0 milestone on Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions