PHPackages                             wbx/file-bundle - 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. wbx/file-bundle

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

wbx/file-bundle
===============

file upload

v0.4.0(6y ago)91.9k2MITPHPPHP &gt;=5.3.2

Since Jun 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ma2thieu/wbxFileBundle)[ Packagist](https://packagist.org/packages/wbx/file-bundle)[ Docs](https://github.com/ma2thieu/wbxFileBundle)[ RSS](/packages/wbx-file-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (7)Used By (0)

```
wbxFileBundle
=============

a Symfony2 Bundle to handle file upload

Installation
============

Bring in the vendor libraries
-----------------------------

This can be done in two different ways:

**Method #1**) Use composer

    "require": {
        "wbx/file-bundle": "*"
    }

**Method #2**) Use deps file

	[wbxFileBundle]
		git=http://github.com/ma2thieu/wbxFileBundle.git
		target=bundles/wbx/FileBundle

**Method #3**) Use git submodules

    git submodule add git://github.com/ma2thieu/wbxFileBundle.git vendor/bundles/wbx/FileBundle

Register the wbxFileBundle namespaces (Not required for composer!)
------------------------------------------------------------------

    // app/autoload.php
    $loader->registerNamespaces(array(
        'wbx'  => __DIR__.'/../vendor/bundles',
        // your other namespaces
    ));

Add wbxFileBundle to your application kernel
--------------------------------------------

	// app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new wbx\FileBundle\wbxFileBundle(),
            // ...
        );
    }

Usage example
=============

Entity
------

	# /src/my/Bundle/Entity/File.php

	namespace my\Bundle\Entity;
	use wbx\FileBundle\Entity\File as wbxFile;

	/**
	 * wbx\CoreBundle\Entity\File
	 *
	 * @Orm\Entity()
	 * @ORM\Table()
	 */
	class File extends wbxFile {

	}

	# /src/my/Bundle/Entity/Object.php
	/**
	 * @var \my\Bundle\Entity\File $file
	 *
	 * @ORM\ManyToOne(targetEntity="\my\Bundle\Entity\File", cascade={"all"})
	 * @ORM\JoinColumn(name="file_id", referencedColumnName="id")
	 */
	private $file;

	$mask_path can be used to point to a bitmap file that will be used as a mask.
	the image will be resized and cropped to the mask dimensions
	(only work with imagick extension)

Form
----

	$builder
		->add('file', new \wbx\FileBundle\Form\FileType($with_empty, $with_name))

* $with_empty (true|false) : display or not the "empty" checkbox to remove the uploaded file
* $with_name (true|false) : display or not the "name" field. Name default to the uploaded filename

* If the php imagick extension is available it is used to create a png preview of uploaded pdf files. $file->getWebPath() will automatically return the preview file.

View
----

	{% include 'wbxFileBundle:File:embed.html.twig' with {
		'form'              : edit_form.image,
		'class'             : "myBundle:File",
		'imagine_filter'    : "my_thumb_filter"
	} %}

*   `form` is mandatory
*   `class` is mandatory (used for the download link)
*   `imagine_filter` is optional: if set the bundle [LiipImagineBundle](http://github.com/liip/LiipImagineBundle) is needed and the value of `imagine_filter` will be used as a the name of the Imagine filter to be called to create and display a thumbnail of the picture.
    If `imagine_filter` is not defined or == "" a link to the file will be displayed
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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 ~389 days

Recently: every ~460 days

Total

6

Last Release

2398d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2457a6bda5f3097386e5ba58348b0c4878ff6b0cba8a0b2c73bfd4d21afef2bd?d=identicon)[ma2thieu](/maintainers/ma2thieu)

---

Top Contributors

[![ma2thieu](https://avatars.githubusercontent.com/u/1158335?v=4)](https://github.com/ma2thieu "ma2thieu (89 commits)")[![colinfrei](https://avatars.githubusercontent.com/u/752836?v=4)](https://github.com/colinfrei "colinfrei (3 commits)")[![fkrauthan](https://avatars.githubusercontent.com/u/1679841?v=4)](https://github.com/fkrauthan "fkrauthan (1 commits)")

---

Tags

fileupload

### Embed Badge

![Health badge](/badges/wbx-file-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/wbx-file-bundle/health.svg)](https://phpackages.com/packages/wbx-file-bundle)
```

###  Alternatives

[kartik-v/bootstrap-fileinput

An enhanced HTML 5 file input for Bootstrap 5.x, 4.x, and 3.x with features for file preview for many file types, multiple selection, ajax uploads, and more.

5.4k7.9M13](/packages/kartik-v-bootstrap-fileinput)[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[sonata-project/media-bundle

Symfony SonataMediaBundle

4625.5M71](/packages/sonata-project-media-bundle)[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.8M95](/packages/kartik-v-yii2-widget-fileinput)[czim/laravel-paperclip

Laravel Eloquent file attachment solution

80802.1k6](/packages/czim-laravel-paperclip)

PHPackages © 2026

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