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

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

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)

v1.1.1(3y ago)2286.8M—5.7%92[8 issues](https://github.com/kartik-v/yii2-widget-fileinput/issues)[2 PRs](https://github.com/kartik-v/yii2-widget-fileinput/pulls)20BSD-3-ClausePHP

Since Nov 9Pushed 2y ago17 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (13)Used By (20)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-widget-fileinput ---

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
=========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-widget-fileinput--------------------)

[![Stable Version](https://camo.githubusercontent.com/3da7edd76a31749e34a279e9c30f724ca7c65b31c2f222c0c1141aa9d6ec0e8b/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d66696c65696e7075742f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-fileinput)[![Unstable Version](https://camo.githubusercontent.com/7e20fb651055d49a1ccdd7231779c7f2e560e162d34134f98629f43f62f11870/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d66696c65696e7075742f762f756e737461626c65)](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.x, 4.x and 5.x 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.

Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-fileinput/blob/master/CHANGE.md) for details of release wise changes.

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]
]);
```

Contributors
------------

[](#contributors)

### Code Contributors

[](#code-contributors)

This project exists thanks to all the people who contribute. \[[Contribute](CONTRIBUTING.md)\]. [![](https://camo.githubusercontent.com/cf105eeffccd0f4cd1eb40fbd823da666db5a2816cbf56c4101bfe347e02e488/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f636f6e7472696275746f72732e7376673f77696474683d38393026627574746f6e3d66616c7365)](https://github.com/kartik-v/yii2-widget-fileinput/graphs/contributors)

### Financial Contributors

[](#financial-contributors)

Become a financial contributor and help us sustain our community. \[[Contribute](https://opencollective.com/yii2-widget-fileinput/contribute)\]

#### Individuals

[](#individuals)

[![](https://camo.githubusercontent.com/3ae019e09374ee796d23fafe55c62e268be0c688dcbd636653f13172a1019176/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f696e646976696475616c732e7376673f77696474683d383930)](https://opencollective.com/yii2-widget-fileinput)

#### Organizations

[](#organizations)

Support this project with your organization. Your logo will show up here with a link to your website. \[[Contribute](https://opencollective.com/yii2-widget-fileinput/contribute)\]

[![](https://camo.githubusercontent.com/87ef3e6d5180b6e5e2f7010f4b014bef169d3233088b0635b96183d8781bbf62/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f302f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/0/website)[![](https://camo.githubusercontent.com/8d3a4903f3bf48afd1636b33852b3ba96a4e0f220c2b774aea3426fd7b14c97d/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f312f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/1/website)[![](https://camo.githubusercontent.com/30d9a121c6dae13970c5758bc0a8eb5962efaeb4e39090c4b8b54a7de3e5bae6/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f322f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/2/website)[![](https://camo.githubusercontent.com/fe5b78c9b366f1d14a846dbc214771ed84367d39876d836397a1fd0838487e02/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f332f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/3/website)[![](https://camo.githubusercontent.com/5b1e0f09b665026c8897925c84ad78e8c3b2547a15272332a12eb957cccf7b3a/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f342f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/4/website)[![](https://camo.githubusercontent.com/02b72e52be5a0c2ed3e939f680e50a35294f57c1d9289ca02c66d7e3c31c410e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f352f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/5/website)[![](https://camo.githubusercontent.com/88f40697000675306d8117192722a044e08c6f417f828ca5e8a725614f88c21b/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f362f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/6/website)[![](https://camo.githubusercontent.com/fb4a0403ab7f48145b35f4d95ed608b736b64fa11682ba83c34cf3e5716de8b5/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f372f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/7/website)[![](https://camo.githubusercontent.com/da190f64f3dfefc52ae5e216692576e2ffb5aa27f212964b9e9e4ab30f5f8b39/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f382f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/8/website)[![](https://camo.githubusercontent.com/3d892d8ef594cdc7455211a66ac8f7a15daf459e92dc0a5fa4cdb2cb8f4a885e/68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f796969322d7769646765742d66696c65696e7075742f6f7267616e697a6174696f6e2f392f6176617461722e737667)](https://opencollective.com/yii2-widget-fileinput/organization/9/website)

License
-------

[](#license)

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

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity64

Solid adoption and visibility

Community46

Growing community involvement

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 67.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 ~253 days

Recently: every ~347 days

Total

12

Last Release

1421d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (56 commits)")[![deividas1](https://avatars.githubusercontent.com/u/12512225?v=4)](https://github.com/deividas1 "deividas1 (3 commits)")[![chaintng](https://avatars.githubusercontent.com/u/2979072?v=4)](https://github.com/chaintng "chaintng (3 commits)")[![art40100](https://avatars.githubusercontent.com/u/33236770?v=4)](https://github.com/art40100 "art40100 (2 commits)")[![kenjebaev](https://avatars.githubusercontent.com/u/20373911?v=4)](https://github.com/kenjebaev "kenjebaev (2 commits)")[![sosojni](https://avatars.githubusercontent.com/u/3853867?v=4)](https://github.com/sosojni "sosojni (2 commits)")[![iamguba](https://avatars.githubusercontent.com/u/14358417?v=4)](https://github.com/iamguba "iamguba (1 commits)")[![kangqf](https://avatars.githubusercontent.com/u/5372027?v=4)](https://github.com/kangqf "kangqf (1 commits)")[![lichunqiang](https://avatars.githubusercontent.com/u/2433916?v=4)](https://github.com/lichunqiang "lichunqiang (1 commits)")[![mehrna](https://avatars.githubusercontent.com/u/6211768?v=4)](https://github.com/mehrna "mehrna (1 commits)")[![monkeywithacupcake](https://avatars.githubusercontent.com/u/7316730?v=4)](https://github.com/monkeywithacupcake "monkeywithacupcake (1 commits)")[![muhammadcahya](https://avatars.githubusercontent.com/u/4241620?v=4)](https://github.com/muhammadcahya "muhammadcahya (1 commits)")[![nikosid](https://avatars.githubusercontent.com/u/1609434?v=4)](https://github.com/nikosid "nikosid (1 commits)")[![RobinKamps](https://avatars.githubusercontent.com/u/27373333?v=4)](https://github.com/RobinKamps "RobinKamps (1 commits)")[![4khobta](https://avatars.githubusercontent.com/u/9838551?v=4)](https://github.com/4khobta "4khobta (1 commits)")[![syedmuneer](https://avatars.githubusercontent.com/u/19424588?v=4)](https://github.com/syedmuneer "syedmuneer (1 commits)")[![boliver20](https://avatars.githubusercontent.com/u/3207245?v=4)](https://github.com/boliver20 "boliver20 (1 commits)")[![ddinchev](https://avatars.githubusercontent.com/u/1397692?v=4)](https://github.com/ddinchev "ddinchev (1 commits)")[![EvilKarter](https://avatars.githubusercontent.com/u/3779278?v=4)](https://github.com/EvilKarter "EvilKarter (1 commits)")[![giannisdag](https://avatars.githubusercontent.com/u/2151129?v=4)](https://github.com/giannisdag "giannisdag (1 commits)")

---

Tags

pluginfilejqueryuploadyii2extensionwidgetforminput

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-widget-select2

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

3279.7M191](/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)[kartik-v/yii2-widget-datepicker

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

1097.0M60](/packages/kartik-v-yii2-widget-datepicker)

PHPackages © 2026

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