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

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

Since Sep 15Pushed 1mo 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 4w ago

READMEChangelog (10)Dependencies (24)Versions (78)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.project_dir%/public/uploads/entity_images'
            upload_directory_url: uploads/entity_images
            max_size: 4194304 # 4Mb
            allowed_mimetypes: [image/jpeg, image/gif, image/png]

    orphanage:
        lifetime: 86400

```

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

```
#  app/config/routing.yaml

glavweb_uploader:
    resource: '@GlavwebUploaderBundle/config/routing.yaml'
    prefix:   /
```

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

[](#basic-usage)

1. Added attributes for the entity which needs to support "GlavwebUploadable". "#\[Glavweb\\Uploadable\]" before you can define an entity class:

```
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Glavweb\UploaderBundle\Entity\Media;
use Glavweb\UploaderBundle\Mapping\Attribute as Glavweb;

#[ORM\Entity]
#[Glavweb\Uploadable()]
class Entity
{
}

```

And another attribute "#\[Glavweb\\UploadableField\]" before defining the properties of a many-to-many:

```
#[ORM\ManyToMany(targetEntity: Media::class, inversedBy: "entities", orphanRemoval: true)]
#[ORM\OrderBy(["position" => "ASC"])]
#[Glavweb\UploadableField([mapping => "entity_images"])]
private Collection $images;

public function __construct()
{
    ...
    $this->images = new ArrayCollection();
}

```

Or many-to-one:

```
#[ORM\OneToOne(targetEntity: Media::class, orphanRemoval: true)]
#[ORM\JoinColumn(name: "image_id", referencedColumnName: "id", nullable: true, onDelete: "SET NULL")]
#[Glavweb\UploadableField([mapping => "entity_images"])]
private ?Media $image = null;

```

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

60

—

FairBetter than 98% of packages

Maintenance84

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity96

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 56.8% 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 ~53 days

Recently: every ~109 days

Total

75

Last Release

46d ago

Major Versions

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

v3.7.1 → v4.0.02026-06-23

PHP version history (5 changes)2.5.0PHP 7.2

2.5.1PHP ^7.2

v3.0.0PHP ^7.2.5

v3.5.1PHP &gt;=7.2.5

v4.0.0PHP &gt;=8.4

### 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 (22 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.3k18.3M414](/packages/easycorp-easyadmin-bundle)[sylius/sylius

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

8.5k6.0M766](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1301.7M3.0k](/packages/contao-core-bundle)[pimcore/pimcore

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

3.8k3.9M532](/packages/pimcore-pimcore)[sulu/sulu

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

1.3k1.4M225](/packages/sulu-sulu)[oro/platform

Business Application Platform (BAP)

645146.3k117](/packages/oro-platform)

PHPackages © 2026

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