PHPackages                             stratoss/yii2-widget-fileinput - 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. stratoss/yii2-widget-fileinput

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

stratoss/yii2-widget-fileinput
==============================

An enhanced FileInput widget for Bootstrap 3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

v999.1(10y ago)018BSD-3-ClausePHP

Since Nov 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/stratoss/yii2-widget-fileinput)[ Packagist](https://packagist.org/packages/stratoss/yii2-widget-fileinput)[ Docs](https://github.com/kartik-v/yii2-widget-fileinput)[ RSS](/packages/stratoss-yii2-widget-fileinput/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (8)Used By (0)

yii2-widget-fileinput
=====================

[](#yii2-widget-fileinput)

[![Latest Stable Version](https://camo.githubusercontent.com/3da7edd76a31749e34a279e9c30f724ca7c65b31c2f222c0c1141aa9d6ec0e8b/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d66696c65696e7075742f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-fileinput)[![License](https://camo.githubusercontent.com/df5da9a004e6bddd6684b3d572e4bc67629b79e879014351b190bcf2b2578d0c/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d66696c65696e7075742f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-widget-fileinput)[![Total Downloads](https://camo.githubusercontent.com/f6705c64d6fb76b87e2b211adf251dbbe8a32efd7d081452d57a122b7f5765dc/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d66696c65696e7075742f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-widget-fileinput)[![Monthly Downloads](https://camo.githubusercontent.com/55b2aa7d5cf9b5c77b8d0333ae178827c07372e4637a593b2871e200b3cf3d92/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d66696c65696e7075742f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-widget-fileinput)[![Daily Downloads](https://camo.githubusercontent.com/64f3f71ecd84721f6dbe9c5ba7729b67be64d15e3764e4421d1f2ad9630eea52/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d66696c65696e7075742f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-widget-fileinput)

The FileInput widget is a customized file input widget based on Krajee's [Bootstrap FileInput JQuery Plugin](http://plugins.krajee.com/file-input). The widget enhances the default HTML file input with various features including the following:

- Specially styled for Bootstrap 3.0 with customizable buttons, caption, and preview
- Ability to select and preview multiple files
- Includes file browse and optional remove and upload buttons.
- Ability to format your file picker button styles
- Ability to preview files before upload - images and/or text (uses HTML5 FileReader API)
- Ability to preview multiple files of different types (both images and text)
- Set your upload action/route (defaults to form submit). Customize the Upload and Remove buttons.
- Internationalization enabled for easy translation to various languages

> NOTE: This extension is a sub repo split of [yii2-widgets](https://github.com/kartik-v/yii2-widgets). The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of [yii2-widgets](http://demos.krajee.com/widgets).

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

To install, either run

```
$ php composer.phar require kartik-v/yii2-widget-fileinput "@dev"

```

or add

```
"kartik-v/yii2-widget-fileinput": "@dev"

```

to the `require` section of your `composer.json` file.

Latest Release
--------------

[](#latest-release)

> NOTE: The latest version of the module is v1.0.4. Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details.

Demo
----

[](#demo)

You can refer detailed [documentation and demos](http://demos.krajee.com/widget-details/fileinput) on usage of the extension.

Usage
-----

[](#usage)

```
use kartik\file\FileInput;

// Usage with ActiveForm and model
echo $form->field($model, 'avatar')->widget(FileInput::classname(), [
    'options' => ['accept' => 'image/*'],
]);

// With model & without ActiveForm
echo 'Add Attachments';
echo FileInput::widget([
    'model' => $model,
    'attribute' => 'attachment_1',
    'options' => ['multiple' => true]
]);
```

License
-------

[](#license)

**yii2-widget-fileinput** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 65.5% 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 ~71 days

Total

7

Last Release

3771d ago

Major Versions

v1.0.3 → 999.02016-01-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/2014fb9799a16a8f980d39b66f4da2a64889a432497c80d63f306b22b4d07cc5?d=identicon)[stratoss](/maintainers/stratoss)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (19 commits)")[![chaintng](https://avatars.githubusercontent.com/u/2979072?v=4)](https://github.com/chaintng "chaintng (3 commits)")[![sosojni](https://avatars.githubusercontent.com/u/3853867?v=4)](https://github.com/sosojni "sosojni (2 commits)")[![kangqf](https://avatars.githubusercontent.com/u/5372027?v=4)](https://github.com/kangqf "kangqf (1 commits)")[![giannisdag](https://avatars.githubusercontent.com/u/2151129?v=4)](https://github.com/giannisdag "giannisdag (1 commits)")[![mehrna](https://avatars.githubusercontent.com/u/6211768?v=4)](https://github.com/mehrna "mehrna (1 commits)")[![muhammadcahya](https://avatars.githubusercontent.com/u/4241620?v=4)](https://github.com/muhammadcahya "muhammadcahya (1 commits)")[![boliver20](https://avatars.githubusercontent.com/u/3207245?v=4)](https://github.com/boliver20 "boliver20 (1 commits)")

---

Tags

pluginfilejqueryuploadyii2extensionwidgetforminput

### Embed Badge

![Health badge](/badges/stratoss-yii2-widget-fileinput/health.svg)

```
[![Health](https://phpackages.com/badges/stratoss-yii2-widget-fileinput/health.svg)](https://phpackages.com/packages/stratoss-yii2-widget-fileinput)
```

###  Alternatives

[kartik-v/yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 3.x, 4.x &amp; 5.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

2286.8M94](/packages/kartik-v-yii2-widget-fileinput)[kartik-v/yii2-widget-select2

Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).

3279.7M190](/packages/kartik-v-yii2-widget-select2)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

384.4M13](/packages/kartik-v-yii2-widget-switchinput)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-widget-rangeinput

An enhanced Yii 2 widget encapsulating the HTML 5 range input (sub repo split from yii2-widgets)

193.9M3](/packages/kartik-v-yii2-widget-rangeinput)

PHPackages © 2026

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