PHPackages                             imy/fileview - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. imy/fileview

ActiveLibrary[File &amp; Storage](/categories/file-storage)

imy/fileview
============

文件预览sdk

v3.0.1(5y ago)019↓100%MITPHP

Since Dec 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/WinnerSong/fileview)[ Packagist](https://packagist.org/packages/imy/fileview)[ RSS](/packages/imy-fileview/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

开源文件预览 api 使用 sdk
=================

[](#开源文件预览-api-使用-sdk)

- 提交 sdk 初衷为方便各团队成员快速接入使用
    通过传参数获取文件预览链接、多图片预览链接、提前入列链接
- 使用说明

```
$host = 'https://xxx.xxx.com';
$onlineFileview = new OnlineFileview($host);
//获取文件在线预览链接 demo
/**
 * 获取文件预览地址
 * appendParams 参数可选值如下：
 * officePreviewType 文件预览格式，对 pdf、doc、ppt、dwg 文件有效，可选值 image、pdf，默认 image
 * pdfDownloadDisable 是否允许 pdf 文件下载，对 pdf、doc、ppt、dwg 文件使用 pdf 格式预览时有效，默认为 false
 * cors 文件原始链接是否允许跨域，仅对 pdf 文件预览生效，当原始链接不允许跨域访问时需要设置为 disabled
 * watermarkTxt 预览水印，对所有文件有效，默认没有水印
 * @param $fileOriginUrl 原始文件链接地址
 * @param array $appendParams 可选参数
 * @param bool $urlEncode 是否对参数编码
 * @return string
 */
$fileOriginUrl = 'https://xxx.xxx.oss-cn-shenzhen.aliyuncs.com/test/下载工具.pdf';
$appendParams = [
    'cors' => 'disabled', 'officePreviewType' => 'pdf',
    'pdfDownloadDisable' => true, 'watermarkTxt' => 'water'
];
$onlinePreviewLink = $onlineFileview->getOnlinePreviewLink($fileOriginUrl, $appendParams);
echo "在线预览链接=" . $onlinePreviewLink . "\n";

//多图片预览
/**
 * 获取多图片预览地址
 * appendParams 参数可选值如下：
 * watermarkTxt 预览水印，对所有文件有效，默认没有水印
 * @param $currentPictureUrl 默认打开的图片链接地址
 * @param $picturesUrl 所有预览的图片链接地址
 * @param array $appendParams 可选参数
 * @param bool $urlEncode 是否对参数编码
 * @return string
 */
$currentPictureUrl = 'https://xxx.xxx.oss-cn-shenzhen.aliyuncs.com/test/1.jpg';
$picturesUrl = ['https://xxx.xxx.oss-cn-shenzhen.aliyuncs.com/test/2.jpg', 'https://xxx.xxx.oss-cn-shenzhen.aliyuncs.com/test/1.jpg'];
$appendParams = ['watermarkTxt' => 'water'];
$picturesPreviewLink = $onlineFileview->getPicturesPreviewLink($currentPictureUrl, $picturesUrl, $appendParams);
echo "多图片预览链接=" . $picturesPreviewLink . "\n";

//提前入列
/**
 * 获取入列转码链接
 * @param $fileOriginUrl 原始文件链接地址
 * @param array $appendParams 可选参数
 * @param bool $urlEncode
 * @return string
 */
$fileOriginUrl = 'https://xxx.xxx.oss-cn-shenzhen.aliyuncs.com/演示文稿1.pptx';
$addTaskLink = $onlineFileview->getAddTaskLink($fileOriginUrl, []);
echo "提前入列链接=" . $addTaskLink . "\n";

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

5

Last Release

1904d ago

Major Versions

1.0.1 → v2.0.02021-01-17

v2.0.0 → v3.0.02021-02-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/225e3ba383c5632b2bc7ba7650477b2f5158170abad3b1ceaaed9b2ea9c21cd0?d=identicon)[Winner](/maintainers/Winner)

---

Top Contributors

[![songzw1024](https://avatars.githubusercontent.com/u/155646694?v=4)](https://github.com/songzw1024 "songzw1024 (5 commits)")

---

Tags

fileview

### Embed Badge

![Health badge](/badges/imy-fileview/health.svg)

```
[![Health](https://phpackages.com/badges/imy-fileview/health.svg)](https://phpackages.com/packages/imy-fileview)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M61](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
