Closed
Milestone
Description
Describe the bug
Quicklook
msedge
Copy file path in context menu(ctrl+shift+c)
To Reproduce
Steps to reproduce the behavior:
- run these command in cmd
cd /d D:\
set dir_name="这是一个名字很长的的文件夹,但其还不会超出MAX_PATH(256)_this is a folder with long name, but its path would not exceed MAX_PATH____________________________________________________________"
set file_name="这是一个名字很长的文件,若和上面的folder同级仍可正常预览,但移动到folder内后就不行了_this is a file with long name. When placed in the same level with folder above, it can be previewed normally. But when placed in the folder above, it cannot.html"
mkdir %dir_name%
echo "content of html" > %file_name%
move %file_name% %dir_name%- preview the file
Expected behavior
preview work with long path
Desktop (please complete the following information):
win10 22H2
Metadata
Metadata
Assignees
Labels
No labels



Activity
Fix long path issue #1643
emako commentedon May 23, 2025
You can check it after version 4.0.1-20 (QuickLook-4.0.1-20-geff9d79.msi)
https://github.com/QL-Win/QuickLook/releases/tag/latest
emako commentedon May 23, 2025
If there are any questions, please continue to comment.
1821746019 commentedon May 24, 2025
I install the v4.0.2-1-gd20eb71. It failed still. I think it will be nice to translate the long path to the short one before passing the path, like what ctrl+shift+c do.
emako commentedon May 24, 2025
I'll keep track of the problem.
1821746019 commentedon Jun 4, 2025
Is there any good news?
1821746019 commentedon Oct 1, 2025
@emako 大佬, 什么时候把这个bug修修
emako commentedon Oct 1, 2025
Since this involves the underlying codebase architecture, it can be considered a relatively low priority.
1821746019 commentedon Oct 2, 2025
😥
emako commentedon Oct 6, 2025
测试下来edge(以及WebView2)本身就没法支持路径大于260字符,因此File not found是符合预期的
After testing, edge (and WebView2) cannot support paths greater than 260 characters, so File not found is as expected.
1821746019 commentedon Oct 7, 2025
You've correctly identified the issue. WebView2, like Edge, is limited by the legacy MAX_PATH (260 characters) constraint and fails to load files when this limit is exceeded.
Windows Explorer works around this by converting long paths to their 8.3 short-path equivalent before passing them to other applications. We need to replicate this exact behavior.
The solution is to preprocess file paths before they are passed to WebView2. If a path exceeds the MAX_PATH limit, we must first convert it to its short name alias.
Recommended API
To achieve this, use the GetShortPathNameW Win32 API. This function directly converts a long file path into its 8.3 equivalent.
C/C++ Signature:
By implementing this, WebView2 will receive a compliant path (e.g., D:\THISIS
1\FILE1.HTM) and render the file correctly, mimicking Explorer's functionality.For example:
Original Long Path:
D:\这是一个名字很长的的文件夹...\这是一个名字很长的文件....htmlShould be converted to:
D:\THISIS~1\THISIS~1.HTM (Note: The short name is system-generated)emako commentedon Oct 7, 2025
I thought about it and found a solution.
Fix long path handling issue in HtmlViewer #1643
emako commentedon Oct 7, 2025
Done in 78843d8 and you can try it in preview version
https://github.com/QL-Win/QuickLook/releases/tag/latest
1821746019 commentedon Oct 8, 2025
Nice job. It works now.👍
Fix long path issue QL-Win#1643
Fix long path handling issue in HtmlViewer QL-Win#1643