PHPackages                             tps/dnd-file-upload-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. tps/dnd-file-upload-bundle

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

tps/dnd-file-upload-bundle
==========================

The bundle offers a twig filter for creating drag-and-drop file-uploads in your symfony2 app

0.2.x-dev(11y ago)180Beer-LicensePHPPHP &gt;=5.3.2CI failing

Since Nov 4Pushed 11y agoCompare

[ Source](https://github.com/leberknecht/DndFileUploadBundle)[ Packagist](https://packagist.org/packages/tps/dnd-file-upload-bundle)[ Docs](https://github.com/leberknecht/DndFileUploadBundle)[ RSS](/packages/tps-dnd-file-upload-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/ac58d458fea415010828b629f5fe2d938abf910d0da4b3c5dedd979d44a68ade/68747470733a2f2f7472617669732d63692e6f72672f6c656265726b6e656368742f446e6446696c6555706c6f616442756e646c652e706e67)](https://travis-ci.org/leberknecht/DndFileUploadBundle)[![Coverage Status](https://camo.githubusercontent.com/d3dd4b6601740a049efbd3d44c5b71691d66665f868608c6dc241baa0e33a50d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6c656265726b6e656368742f446e6446696c6555706c6f616442756e646c652f62616467652e706e67)](https://coveralls.io/r/leberknecht/DndFileUploadBundle)

Drag-And-Drop File-Upload Bundle
================================

[](#drag-and-drop-file-upload-bundle)

A drag-and-drop file-upload bundle for symfony2

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

[](#installation)

Add the following line to your composer.json:

```
require: "tps/dnd-file-upload-bundle": "dev-master"
```

Update your dependencies and activate the bundle in the kernel:

```
//app/AppKernel.php
$bundles = array(
    [...]
    new \tps\DndFileUploadBundle\DndFileUploadBundle()
)
```

Usage
-----

[](#usage)

### App-Config

[](#app-config)

```
#app/Resources/config/config.yml
dnd_file_upload:
    twig:
        css_class:        dnd-file-upload-container
    upload_directory:     uploads
    allowed_mimetypes:    [ '*' ]
    persist_entity:       true
    entity_class:         Acme\DemoBundle\Entity\MyUploadedFile
```

### Entity

[](#entity)

```
namespace Acme\DemoBundle\Entity;

use tps\DndFileUploadBundle\Entity\File as UploadedFile;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name="file_uploads") //remove this if you dont want to persist
 * @ORM\Entity()
 */
class MyUploadedFile extends UploadedFile
{
     /**
      * @var integer $id
      *
      * @ORM\Column(name="id", type="integer")
      * @ORM\Id
      * @ORM\GeneratedValue(strategy="AUTO")
      */
     protected $id;
}
```

If you want the uploaded files to be persisted in your database, run:

```
app/console doctrine:schema:update --force
```

### Enable routing

[](#enable-routing)

```
# app/Resources/config/routing.yml
dnd_file_upload_routing:
    resource: "@DndFileUploadBundle/Resources/config/routing.yml"
```

### View

[](#view)

If you dont have jQuery included allready, do so before you include bundle snippets:

```

```

#### Loading assets

[](#loading-assets)

Using assetic:

```
{% javascripts
    '@DndFileUploadBundle/Resources/public/js/class.FileUploader.js'
    '@DndFileUploadBundle/Resources/public/js/class.UploadThreadWrapper.js'
    '@DndFileUploadBundle/Resources/public/js/bind.js'
%}

{% endjavascripts %}
```

Using "normal" assets:

```
{% block javascripts %}
    {{ parent() }}

{% endblock %}

{% block stylesheets %}
    {{ parent() }}

{% endblock %}
```

#### create upload-container

[](#create-upload-container)

Finally, create the upload-container (the "file-upload-container" parameter is the id of the container in the DOM, use it for styling):

```
{# Acme\DemoBundle\Resources\views\index.html.twig #}
{% block body %}
    {{ DndFileUploadContainer('file-upload-container') }}
{% endblock %}
```

### To Do

[](#to-do)

- add JS tests

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~9 days

Total

2

Last Release

4246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb3e4551b94ec07c9b3bd27e1ad067f1e4dc3a132bacc81acdd23c15a0ab3bdb?d=identicon)[leberknecht](/maintainers/leberknecht)

---

Top Contributors

[![leberknecht](https://avatars.githubusercontent.com/u/1165177?v=4)](https://github.com/leberknecht "leberknecht (11 commits)")

---

Tags

uploaddragdropdnd

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tps-dnd-file-upload-bundle/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

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

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

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

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

8.5k5.8M712](/packages/sylius-sylius)[open-dxp/opendxp

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

9317.2k55](/packages/open-dxp-opendxp)[oro/platform

Business Application Platform (BAP)

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

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

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

PHPackages © 2026

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