[GH-ISSUE #576] Incorrect Path Separators in ZIP Archives Generated on Windows #341

Closed
opened 2026-04-08 16:52:11 +03:00 by zhus · 0 comments
Owner

Originally created by @cppbear on GitHub (Apr 18, 2025).
Original GitHub issue: https://github.com/sigoden/dufs/issues/576

Problem

When serving files through dufs on Windows platforms, downloading a folder with multi-level directory structure as a ZIP archive results in incorrect path separators in filenames. The ZIP files generated use backslashes \ instead of the forward slashes / required by the ZIP specification (section 4.4.17).

This deviation from the standard may also be the cause of the issue reported in #227.

Steps to reproduce:

  1. Serve a folder containing nested directories via dufs on Windows
  2. Download the folder as a ZIP archive through the web interface
  3. Inspect the ZIP file contents

Expected behavior:
All directory separators in ZIP entries should use forward slashes /

Actual behavior:
Directory separators appear as backslashes \

Configuration

serve-path: 'E:\test'
bind: 0.0.0.0
port: 5000
path-prefix: /dufs
hidden:
  - tmp
  - '*.log'
  - '*.lock'
auth:
  - '@/'
allow-all: false
allow-upload: true
allow-delete: true
allow-search: true
allow-symlink: true
allow-archive: true
enable-cors: true
assets: E:\dufs\assets
log-format: '$remote_addr $remote_user "$request" $status'
log-file: E:\dufs\logs\dufs.log
compress: medium

Log

2025-04-18T19:58:14+08:00 INFO - 127.0.0.1 - "GET /dufs/" 200
2025-04-18T19:58:19+08:00 INFO - 127.0.0.1 - "GET /dufs/?zip" 200

Screenshots/Media

The directory structure is:

E:\test
├── dir1
│   └── file1.txt
├── dir2
│   └── file2.txt
└── file.txt


The ZIP file: test.zip

Environment Information

  • Dufs version: 0.43.0
  • Browser/Webdav info: Microsoft Edge 136.0.3240.14
  • OS info: Windows 11 Build 26200.5551
  • Proxy server (if any): None
Originally created by @cppbear on GitHub (Apr 18, 2025). Original GitHub issue: https://github.com/sigoden/dufs/issues/576 **Problem** <!-- Provide a clear and concise description of the bug you're experiencing. What did you expect to happen, and what actually happened? --> When serving files through dufs on Windows platforms, downloading a folder with multi-level directory structure as a ZIP archive results in incorrect path separators in filenames. The ZIP files generated use backslashes `\` instead of the forward slashes `/` required by the [ZIP specification](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) (section 4.4.17). This deviation from the standard may also be the cause of the issue reported in #227. Steps to reproduce: 1. Serve a folder containing nested directories via dufs on Windows 2. Download the folder as a ZIP archive through the web interface 3. Inspect the ZIP file contents Expected behavior: All directory separators in ZIP entries should use forward slashes `/` Actual behavior: Directory separators appear as backslashes `\` **Configuration** <!-- Please specify the Dufs command-line arguments or configuration used. --> <!-- If the issue is related to authentication/permissions, include auth configurations while concealing sensitive information (e.g., passwords). --> ```yaml serve-path: 'E:\test' bind: 0.0.0.0 port: 5000 path-prefix: /dufs hidden: - tmp - '*.log' - '*.lock' auth: - '@/' allow-all: false allow-upload: true allow-delete: true allow-search: true allow-symlink: true allow-archive: true enable-cors: true assets: E:\dufs\assets log-format: '$remote_addr $remote_user "$request" $status' log-file: E:\dufs\logs\dufs.log compress: medium ``` **Log** <!-- Attach relevant log outputs that can help diagnose the issue. --> ```log 2025-04-18T19:58:14+08:00 INFO - 127.0.0.1 - "GET /dufs/" 200 2025-04-18T19:58:19+08:00 INFO - 127.0.0.1 - "GET /dufs/?zip" 200 ``` **Screenshots/Media** <!-- If applicable, add screenshots or videos that help illustrate the issue, especially for WebUI problems. --> The directory structure is: ``` E:\test ├── dir1 │   └── file1.txt ├── dir2 │   └── file2.txt └── file.txt ``` <img align="top" src=https://github.com/user-attachments/assets/cd5b79e2-0a77-4a65-9b62-656f7ef763e3 width=40% /> <img align="top" src=https://github.com/user-attachments/assets/871c1400-b66f-447c-88b9-97f9a692eccb width=50% /> <br /> <br /> The ZIP file: [test.zip](https://github.com/user-attachments/files/19812498/test.zip) **Environment Information** - Dufs version: 0.43.0 - Browser/Webdav info: Microsoft Edge 136.0.3240.14 - OS info: Windows 11 Build 26200.5551 - Proxy server (if any): <!-- e.g. nginx, cloudflare --> None
zhus closed this issue 2026-04-08 16:52:11 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#341