Zdir PHP Directory Listing Tool Updated to v1.50
Zdir is a directory listing program developed using PHP. It requires no database, features simple installation, and is easy to use. The following details the updates in version 1.50.

Video Introduction
Zdir Features
- Directory browsing
- Markdown file preview
- One-click copy for CSS/JavaScript
- File hash generation
- Image preview
- Video playback (supports .mp4, .ts, .m3u8, and other formats)
- Audio playback (supports .mp3, .wav, .flac, .ape)
- Text viewer (supports .txt, .sh, .py, .go, .c, .cpp)
- Office online preview (supports .doc, .docx, .xls, .xlsx, .ppt, .pptx); Note: Preview is not supported for intranet or IP-based access
- File indexing
- QR code generation
- File management (upload, delete, edit, etc.)
- File search
- Password verification
- Chinese language support
v1.50 Update Notes
- Zdir can now be installed in a subdirectory
- CSS optimization
- Bug fixes
- Automatic loading of website statistics by creating
static/tongji.jsand adding tracking code - Username and password for the file manager can be customized in
config.php config.jsonnow supports ad configuration
Zdir Can Now Be Installed in a Subdirectory
Starting from version 1.50, Zdir supports running in a subdirectory. For example, if your site directory is /data/wwwroot/default, you can place the Zdir source code in /data/wwwroot/default/zdir. To run correctly in a subdirectory, you must configure pseudo-static rules. For specific instructions, please refer to the help documentation: https://www.yuque.com/helloz/zdir/install
Support for Adding Statistics Code
In this version, you can create a file named tongji.js in the Zdir directory and insert your website statistics code. Zdir will automatically load it. Note that the statistics code should not include script tags. Baidu statistics have been tested and work correctly; other statistics services have not been tested.
Left and Right Floating Ad Configuration
This version supports setting floating ads on the left and right sides of the website. To enable this, create a file named config.json in the Zdir directory with the following content:
{
"gg":{
"gg_left":"<a href='https://dwz.ovh/d' target='_blank' rel="noopener noreferrer"><img src='https://dwz.ovh/c'></a>",
"gg_right":"<a href='https://blog.xiaoz.org/archives/11183' target='_blank' rel="noopener noreferrer"><img src='https://i.bmp.ovh/imgs/2019/11/39adab31131a53a8.png'></a>"
}
}
The display effect is shown in the image below:

Upgrade Method
Due to changes in the directory structure in this version, it is recommended to back up your data and reinstall Zdir.
Obtaining the Donor Version
Scan the QR code below. Donating more than 30 yuan will grant you access to the donor version, which includes initial technical support and ad removal. After donating, please contact me via QQ: 337003006.

Other Resources
- Demo Site 1: http://soft.xiaoz.org/
- Demo Site 2: https://libs.xiaoz.top/
- Help Documentation: https://dwz.ovh/zdir
- Source Code: https://github.com/helloxz/zdir