terremoth/php-win32-filepicker
最新稳定版本:v1.0.2
Composer 安装命令:
composer require terremoth/php-win32-filepicker
包简介
Use native Windows Explorer File Selector to select a file on PHP
README 文档
README
Calls Windows Explorer to select file(s).
You are able to configure to select 1 or multiple files, filtering by extensions or let the user free to choose any.
Unlocked by the power of PHP's FFI
Not because we must do it, but because we can!
Made by Terremoth with ⚡ & ❤
Installation
composer require terremoth/php-win32-filepicker
Documentation
require_once 'vendor/autoload.php'; use Terremoth\Win32\FilePicker; $selectedDirectory = $_SERVER['USERPROFILE'] ?? 'C:\\'; // optional $fp = new FilePicker($selectedDirectory); // $selectedDirectory can be null without problem. // all methods below are *optional*: $fp ->selectMultipleFiles() ->addExtensionsFilter(['png', 'jpg', 'gif', 'avif', 'webp', 'jpeg', 'ico', 'bmp']) ->filterOnlySelectedExtensions() ->setDefaultExtensionSearch('png') ; $selectedFiles = $fp->open(); print_r($selectedFiles); // if no files were selected, an empty array will be returned 😉
That's it!
See demos/demo.php for this example.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-03-06