PHPackages                             glavweb/uploader-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. glavweb/uploader-bundle

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

glavweb/uploader-bundle
=======================

Symfony GlavwebUploaderBundle

v3.7.1(6mo ago)32.8k2[1 issues](https://github.com/glavweb/GlavwebUploaderBundle/issues)[1 PRs](https://github.com/glavweb/GlavwebUploaderBundle/pulls)2PHPPHP &gt;=7.2.5CI failing

Since Sep 15Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/glavweb/GlavwebUploaderBundle)[ Packagist](https://packagist.org/packages/glavweb/uploader-bundle)[ RSS](/packages/glavweb-uploader-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (10)Dependencies (12)Versions (77)Used By (2)

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

[](#installation)

### Get the bundle using composer

[](#get-the-bundle-using-composer)

Add GlavwebUploaderBundle by running this command from the terminal at the root of your Symfony project:

```
php composer.phar require glavweb/uploader-bundle
```

### Enable the bundle

[](#enable-the-bundle)

To start using the bundle, register the bundle in your application's kernel class:

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Glavweb\UploaderBundle\GlavwebUploaderBundle(),
        // ...
    );
}
```

### Configure the bundle

[](#configure-the-bundle)

This bundle was designed to just work out of the box. The only thing you have to configure in order to get this bundle up and running is a mapping.

```
# app/config/config.yml

glavweb_uploader:
    mappings:
        entity_images:
            providers :
                - glavweb_uploader.provider.image
            use_orphanage: true
            upload_directory:     %kernel.root_dir%/../web/uploads/entity_images
            upload_directory_url: uploads/entity_images
            max_size: 4194304 # 4Mb
            allowed_mimetypes: [image/jpeg, image/gif, image/png]

    orphanage:
        lifetime: 86400
        directory: %kernel.cache_dir%/uploader/orphanage

```

To enable the dynamic routes, add the following to your routing configuration file.

```
#  app/config/routing.yml

glavweb_uploader:
    resource: "@GlavwebUploaderBundle/Resources/config/routing.yml"
    prefix:   /
```

Basic Usage
===========

[](#basic-usage)

1. Added annotations for the entity which needs to support "GlavwebUploadable". "@Glavweb\\Uploadable" before you can define an entity class:

```
use Glavweb\UploaderBundle\Mapping\Annotation as Glavweb;

/**
 * Entity
 *
 * @Glavweb\Uploadable
 */
class Entity
{
}

```

And another annotation "@Glavweb\\UploadableField" before defining the properties of a many-to-many:

```
/**
 * @var \Doctrine\Common\Collections\Collection
 *
 * @ORM\ManyToMany(targetEntity="Glavweb\UploaderBundle\Entity\Media", inversedBy="entities", orphanRemoval=true)
 * @ORM\OrderBy({"position" = "ASC"})
 * @Glavweb\UploadableField(mapping="entity_images")
 */
private $images;

/**
 * Constructor
 */
public function __construct()
{
    ...
    $this->images = new \Doctrine\Common\Collections\ArrayCollection();
}

```

Or many-to-one:

```
/**
 * @var Media
 *
 * @ORM\OneToOne(targetEntity="Glavweb\UploaderBundle\Entity\Media", orphanRemoval=true)
 * @ORM\JoinColumn(name="image_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
 */
private $image;

```

2. For build form, you can use [GlavwebUploaderDropzoneBundle](https://github.com/glavweb/GlavwebUploaderDropzoneBundle).

Events
------

[](#events)

Bundle has 3 events:

- glavweb\_uploader.validation; // First event, will execute before your file will be uploaded
- glavweb\_uploader.pre\_upload; // Will execute before your file will be uploaded
- glavweb\_uploader.post\_upload. // Will execute after your file will be uploaded

### Example

[](#example)

As example we use post upload event.

services.yml:

```
post_upload_listener:
    class: AppBundle\Listener\PostUploadListener
    tags:
        - { name: kernel.event_listener, event: glavweb_uploader.post_upload, method: onPostUpload }

```

Listener class:

```
namespace AppBundle\Listener;

use Glavweb\UploaderBundle\Event\PostUploadEvent;

class PostUploadListener
{
    /**
     * @param PostUploadEvent $event
     */
    public function onPostUpload(PostUploadEvent $event)
    {
        // Some logic
    }
}

```

Other listeners work on a similar logics.

Also you can define listeners only for your context, as example if context is "article":

```
article_post_upload_listener:
    class: AppBundle\Listener\ArticlePostUploadListener
    tags:
        - { name: kernel.event_listener, event: glavweb_uploader.post_upload.article, method: onPostUpload }

```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance61

Regular maintenance activity

Popularity24

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 57.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 ~51 days

Recently: every ~66 days

Total

74

Last Release

191d ago

Major Versions

v2.9.1 → v3.4.12023-04-03

v2.9.5 → v3.4.22023-05-09

v2.9.6 → v3.5.02023-05-23

v2.12.1 → v3.6.02025-01-04

v2.13.1 → v3.7.12025-12-14

PHP version history (4 changes)2.5.0PHP 7.2

2.5.1PHP ^7.2

v3.0.0PHP ^7.2.5

v3.5.1PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/323641293a1149ed44abfdf39f33c2d931f6cf8fda5bf2f269a2c80c3afe9c69?d=identicon)[nilov](/maintainers/nilov)

---

Top Contributors

[![nilov](https://avatars.githubusercontent.com/u/1862113?v=4)](https://github.com/nilov "nilov (46 commits)")[![Nitro-N](https://avatars.githubusercontent.com/u/4936491?v=4)](https://github.com/Nitro-N "Nitro-N (21 commits)")[![Fafnur](https://avatars.githubusercontent.com/u/3624224?v=4)](https://github.com/Fafnur "Fafnur (10 commits)")[![f5rus](https://avatars.githubusercontent.com/u/9019482?v=4)](https://github.com/f5rus "f5rus (2 commits)")[![koloszko](https://avatars.githubusercontent.com/u/2341208?v=4)](https://github.com/koloszko "koloszko (1 commits)")

### Embed Badge

![Health badge](/badges/glavweb-uploader-bundle/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k16.8k](/packages/prestashop-prestashop)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M462](/packages/pimcore-pimcore)

PHPackages © 2026

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