Skip to content

Downloading will fail if the filename is the same as the folder #175

@gyzong1

Description

@gyzong1

Describe the bug

Downloading will fail if the filename is the same as the folder name

Current behavior

For example:
There is a file named "test" and the folder is also named "test". When we download the folder, it will fail:

Image Image

As a comparison, the file "test2" is downloaded successfully.

Reproduction steps

  1. Download JFrog CLI:
    wget https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.77.0/jfrog-cli-linux-arm64/jfrog

  2. Configuration:
    jf rt c add

  3. Download folders/files:
    [root@centos generic]# jfrog rt dl "example-repo-local/a/b/(*)" path/{1} --retries=6 --threads=16 --include-dirs=true --recursive=true --flat=true
    17:48:47 [Debug] JFrog CLI version: 2.77.0
    17:48:47 [Debug] OS/Arch: linux/arm64
    17:48:47 [Debug] Trace ID for JFrog Platform logs: c5a30f8cabd2e523
    17:48:47 [Debug] Using server-id configuration
    17:48:47 [🔵Info] Log path: /root/.jfrog/logs/jfrog-cli.2025-07-18.17-48-47.14183.log
    {
    "status": "success",
    "totals": {
    "success": 1,
    "failure": 0
    }
    }
    [root@centos generic]#
    [root@centos generic]#
    [root@centos generic]# cat /root/.jfrog/logs/jfrog-cli.2025-07-18.17-48-47.14183.log
    [Debug] Sending HTTP GET request to: http://<Arti_URL>/artifactory/api/system/version
    [Debug] Sending HTTP GET request to: http://<Arti_URL>/artifactory/api/system/version
    [Debug] Artifactory response: 200 OK
    [Debug] Artifactory Call Home: Sending info...
    [Debug] Sending HTTP POST request to: http://<Arti_URL>/artifactory/api/system/usage
    [Debug] Artifactory response: 200 OK
    [Debug] JFrog Artifactory version is: 7.35.2
    [Debug] Searching Artifactory using AQL query:
    items.find({"type":"any","path":{"$ne":"."},"$or":[{"$and":[{"repo":"example-repo-local","path":"a/b","name":{"$match":""}}]},{"$and":[{"repo":"example-repo-local","path":{"$match":"a/b/"},"name":{"$match":"*"}}]}]}).include("name","repo","path","actual_md5","actual_sha1","sha256","size","type","modified","created","property")
    [Debug] Sending HTTP POST request to: http://<Arti_URL>/artifactory/api/search/aql
    [Debug] Artifactory response: 200 OK
    [Debug] Streaming data to file...
    [Debug] Finished streaming data successfully.
    [Debug] Attempting to remove file: %s /tmp/jfrog.cli.temp.-1752832127-460514284
    [Debug] Attempting to remove file: %s /tmp/jfrog.cli.temp.-1752832127-4274761144
    [Debug] Attempting to remove file: %s /tmp/jfrog.cli.temp.-1752832127-3530068722
    [Info] [Thread 15] Downloading "example-repo-local/a/b/c/test/test2" to "path/c/test/test2"
    [Debug] Sending HTTP GET request to: http://<Arti_URL>/artifactory/example-repo-local/a/b/c/test/test2
    [Info] [Thread 7] Creating folder: path/c/test/test
    [Debug] [Thread 15] Artifactory response: 200 OK
    [Debug] Downloaded 1 artifacts.
    [root@centos generic]#
    [root@centos generic]#
    [root@centos generic]#
    [root@centos generic]# ll path/c/test/
    total 4
    drwxr-xr-x 1 root root 0 Jul 18 17:48 test
    -rw-r--r-- 1 root root 3 Jul 18 17:48 test2

Expected behavior

The file "test" can be downloaded successfully.

JFrog CLI version

2.77.0

Operating system type and version

CentOS Stream release 9

JFrog Artifactory version

Artifactory 7.35.2

JFrog Xray version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions